Method, device and equipment for fabric skew detection based on deep learning

By fusing temporal texture and frequency-domain orientation features using deep learning methods and combining them with a dynamic orientation attention mechanism, the accuracy problem of weft skew detection for complex textured fabrics is solved, achieving stable weft angle recognition and low-cost online detection under complex patterns.

CN121236044BActive Publication Date: 2026-04-14CHANGZHOU HONGDA INTELLIGENCE TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGZHOU HONGDA INTELLIGENCE TECHNOLOGY CO LTD
Filing Date
2025-10-23
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing weft skew detection methods struggle to accurately identify weft angles when dealing with complex textures or patterned fabrics, resulting in unstable detection results that fail to meet the real-time quality control requirements of modern high-speed production lines.

Method used

A deep learning-based approach is employed to extract the dominant weft direction in complex patterned fabrics by fusing temporal texture and frequency-domain directional features and using a dynamic directional attention mechanism, combined with a lightweight convolutional network and a regression model.

Benefits of technology

It accurately identifies weft angles under complex patterns, improving the stability and accuracy of detection. It is applicable to various fabric types, reduces deployment costs, and supports online detection and unified detection of different fabric types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121236044B_ABST
    Figure CN121236044B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of fabric skew detection, and provides a fabric skew detection method, device and equipment based on deep learning, which comprises the following steps: collecting a fabric original image, setting a target skew angle list, and expanding the original image through an affine transformation matrix to obtain an input image; preprocessing the input image to generate a time domain graph and a frequency domain mask graph; inputting the time domain graph and the frequency domain mask graph into a double-branch convolution backbone network respectively and performing weighted fusion to obtain a fused feature graph; using a lightweight deep separable convolution network to generate an enhanced feature graph from the fused feature; direction modeling is performed on the enhanced feature graph to form a complete direction feature graph, and the direction feature graph is input into a dynamic direction attention module to generate a fixed dimension feature vector; and the fixed dimension feature vector is input into a skew angle regression model to predict the angle value of the fabric weft. The present application solves the problem that the angle of the weft is prone to prediction errors under a complex pattern in the traditional method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention generally relate to the field of fabric skew detection technology, and particularly to methods, apparatus and equipment for fabric skew detection based on deep learning. Background Technology

[0002] Weft skew is a significant quality issue in textile production, characterized by the weft yarns deviating from their normal horizontal direction and tilting at a certain angle after the warp and weft threads interweave. This defect not only severely impacts the fabric's appearance but also lowers product grade and disrupts the stability of subsequent processes. Therefore, accurate prediction and real-time control of weft skew in weaving, dyeing, finishing, and setting stages are of vital industrial importance.

[0003] Existing methods for detecting weft skew primarily rely on manual inspection and traditional image processing techniques. Manual inspection requires inspectors to judge the weft skew of the fabric texture based on experience. This method is highly subjective, inefficient, and the consistency of results is difficult to guarantee, failing to meet the stringent real-time quality control requirements of modern high-speed production lines. Traditional image processing methods, such as Fourier transform, Hough line detection, and gray-level co-occurrence matrix, aim to identify weft skew by analyzing the directional characteristics of the fabric through algorithms. These methods can achieve relatively accurate results when processing fabrics with clear textures and unidirectional orientations, such as plain weave fabrics. However, in actual industrial production scenarios, the prevalence of complex textures or patterned fabrics significantly limits the applicability of these traditional methods. Complex textures or patterned fabrics typically exhibit intricate patterns superimposed on a basic texture, causing the weft direction information to be obscured or severely interfered with, such as... Figures 2-3 As shown, or if there are obvious interfering factors such as uneven lighting and fabric wrinkles, such as Figures 4-5 As shown, this makes it difficult for traditional algorithms to reliably extract the dominant weft direction, or the texture period of the fabric is often irregular and the directions are intersecting, and the weft direction may have significant inconsistencies in different regions, such as... Figures 6-7 As shown, this further increases the difficulty for traditional algorithms to accurately detect latitude skew. Summary of the Invention

[0004] To address the above issues, this invention effectively extracts the dominant weft direction in complex patterned fabrics by fusing temporal texture and frequency-domain directional features, along with a dynamic directional attention mechanism. Even on complex jacquard fabrics, it can accurately identify the weft angle, solving the problem of predictive errors in complex patterns using traditional methods.

[0005] According to embodiments of the present invention, a method, apparatus, and device for detecting fabric skew based on deep learning are provided.

[0006] In a first aspect of the invention, a method for detecting fabric skew based on deep learning is provided. The method includes:

[0007] Step S01: Acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image through the affine transformation matrix to obtain the input image;

[0008] Step S02: Preprocess the input image to generate a time-domain image and a frequency-domain mask image;

[0009] Step S03: Input the time domain map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency domain orientation feature map representing the fabric, and then perform weighted fusion of the basic texture feature map and the frequency domain orientation feature map to obtain the fused feature map;

[0010] Step S04: Use a lightweight, deep separable convolutional network to generate enhanced feature maps from the fused features;

[0011] Step S05: Perform orientation modeling on the enhanced feature map to form a complete orientation feature map, and input the orientation feature map into the dynamic orientation attention module to generate a fixed-dimensional feature vector;

[0012] Step S06: Input the fixed-dimensional feature vector into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

[0013] Furthermore, the specific steps of step S01 are as follows:

[0014] Step S011: Acquire raw images of the fabric using an industrial camera and set a list of target weft skew angles;

[0015] Step S012: Convert the target latitude angle into radians and calculate the shear coefficient. Construct an affine transformation matrix based on this coefficient.

[0016] Step S013: Generate a new fabric image through an affine transformation matrix, expand the image canvas size using edge reflection filling to obtain a transformed image, and obtain image input samples from different angles for subsequent model training or prediction.

[0017] Furthermore, the specific steps of step S02 are as follows:

[0018] Step S021: Convert the input images to grayscale uniformly and scale them;

[0019] Step S022: Perform histogram equalization on the scaled image to obtain the time-domain image;

[0020] Step S023: Input the input image into the Fast Fourier Transform (FFT) module, and map the image from the spatial domain to the frequency domain using a two-dimensional FFT to obtain a complex frequency domain image; according to the image size Choose the square root normalization strategy and set the normalization factor to 1. Perform a forward FFT operation on the image to obtain a complex spectrum, and use a DC component centering mode to move low-frequency energy to the center of the spectrum; take the modulus of the complex spectrum to obtain the amplitude spectrum, and then perform logarithmic transformation and normalization on the amplitude spectrum to obtain the spectrum diagram.

[0021] Step S024: Binarize the spectrogram to generate a frequency domain mask of texture features, and retain the core frequency information by center cropping;

[0022] Step S025: Normalize the binarized frequency domain mask image numerically for subsequent model feature extraction.

[0023] Furthermore, the specific steps of step S03 are as follows:

[0024] Step S031: Input the temporal map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network, respectively, to obtain the spatial basic texture feature maps representing the overall texture distribution of the fabric. Frequency domain directional feature map reflecting the energy distribution of latitudinal direction and periodic texture. ;

[0025] Step S032: By introducing learnable weight parameters , feature map and feature map Weighted fusion is performed to obtain the final fused feature map. :

[0026] .

[0027] Furthermore, each branch of the dual-branch convolutional backbone network consists of a standard convolutional layer, a deformable convolutional layer, and a max pooling layer, which are connected by a BN layer and a ReLU activation function.

[0028] Furthermore, the specific steps of step S04 are as follows:

[0029] Step S041: Fusion feature map of the input Each channel in the process is used for spatial feature extraction using depthwise convolution. The output of each channel of the convolution is normalized, and the ReLU activation function is applied to the normalized output to obtain the feature map.

[0030] Step S042: Transfer the feature map obtained in step S041 through... After convolution to integrate cross-channel information, enhanced feature maps are generated through BN layers and ReLU activation functions. .

[0031] Furthermore, the specific steps of step S05 are as follows:

[0032] Step S051: Enhance the feature map Multi-directional convolutional filtering is performed to generate response maps in different directions; max pooling and normalization are then applied to the response maps in each direction; finally, the features in each direction are arranged according to their spatial location to form a complete directional feature map. .

[0033] Step S052: Convert the orientation feature map The input attention generation network generates the attention weight matrix through convolutional layers and a sigmoid activation function. ; directional feature map Perform weighted processing:

[0034] ,

[0035] in, This indicates pixel-by-pixel multiplication. The feature map is after attention weighting;

[0036] Step S053: Process the attention-weighted feature map Fixed-dimensional feature vectors are generated through convolutional layers, batch normalization (BN) layers, and ReLU activation. .

[0037] Furthermore, the latitudinal angle regression model consists of a global average pooling layer, several fully connected layers, and an activation function. In the network structure design, the last layer has no activation function.

[0038] Furthermore, the specific steps of step S06 are as follows:

[0039] Step S061: For fixed-dimensional feature vectors Perform global average pooling to compress the spatial dimension into a global description vector with a channel dimension. ;

[0040] Step S062: Transfer the global feature vector The input is fed into a lightweight fully connected regression network, passing through several fully connected layers and activation functions, and outputs the latitudinal angle. .

[0041] In a second aspect of the invention, a device for detecting fabric skew based on deep learning is provided. The device includes:

[0042] The expansion module is used to acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image to obtain the input image through the affine transformation matrix.

[0043] Preprocessing module: Used to preprocess the input image to generate time-domain and frequency-domain mask images;

[0044] The fusion module is used to input the time-domain map and the frequency-domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency-domain orientation feature map representing the fabric, and to perform weighted fusion of the basic texture feature map and the frequency-domain orientation feature map to obtain the fused feature map.

[0045] Enhancement module: Used to generate enhanced feature maps from fused features using a lightweight, deep separable convolutional network;

[0046] Modeling module: Used to perform orientation modeling on the enhanced feature map to form a complete orientation feature map, and input the orientation feature map into the dynamic orientation attention module to generate a fixed-dimensional feature vector;

[0047] Prediction module: Used to input fixed-dimensional feature vectors into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

[0048] In a third aspect of the invention, an electronic device is provided. The electronic device includes a memory and a processor, the memory storing a computer program, the processor executing the program to implement the method according to a first aspect of the invention.

[0049] In a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to a first aspect of the invention.

[0050] This invention effectively extracts the dominant weft direction in complex patterned fabrics by fusing temporal texture and frequency-domain directional features, as well as using a dynamic directional attention mechanism. Even on complex jacquard fabrics, it can accurately identify the weft angle, solving the problem of easy prediction errors in complex patterns using traditional methods.

[0051] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description.

[0052] Beneficial effects:

[0053] 1. By fusing temporal texture and frequency domain directional features, and using a dynamic directional attention mechanism, the dominant weft direction in complex patterned fabrics can be effectively extracted. Even on complex jacquard fabrics, the weft angle can be accurately identified, solving the problem of easy prediction errors in complex patterns using traditional methods.

[0054] 2. By introducing lightweight convolutional networks and regression models, accurate latitudinal angles can still be obtained even in situations with low contrast and wrinkles in industrial settings.

[0055] 3. By enhancing directional features through multi-directional convolutional filtering and attention weighting, stable predictions can be maintained under different fabric types and variations in local texture complexity, thus overcoming the shortcomings of traditional image algorithms in terms of sensitivity to scene changes and poor generalization ability.

[0056] 4. The model structure is lightweight and can process large-scale fabric image data to achieve online detection. It supports a unified detection scheme for different fabric types, eliminating the need for separate parameter tuning for each patterned fabric, reducing deployment costs and improving production line quality control efficiency.

[0057] 5. Applicable to various fabric types, such as plain weave, twill weave, jacquard, mattress fabric, etc. The modular design facilitates integration with existing production line image acquisition and quality monitoring systems. Attached Figure Description

[0058] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Wherein:

[0059] Figure 1 A flowchart of a deep learning-based fabric skew detection method according to an embodiment of the present invention is shown;

[0060] Figure 2 A schematic diagram is shown showing the complex floral structure of the fabric according to the present invention superimposed on the texture with the weft direction being obscured;

[0061] Figure 3 A schematic diagram is shown showing the interference of the weft direction when the complex fabric pattern structure is superimposed on the texture according to the present invention;

[0062] Figure 4 A schematic diagram showing the interference of light on the weft direction of the fabric pattern according to the present invention is shown;

[0063] Figure 5 A schematic diagram showing the interference of pleats on the weft direction of the fabric pattern according to the present invention is shown;

[0064] Figure 6 A schematic diagram showing the irregular periodicity of the fabric pattern texture according to the present invention is shown;

[0065] Figure 7A schematic diagram showing the interlacing of fabric pattern texture directions according to the present invention is shown;

[0066] Figure 8 A schematic diagram of the latitudinal skew training set according to an embodiment of the present invention is shown;

[0067] Figure 9 A schematic diagram of the preprocessing procedure according to an embodiment of the present invention is shown;

[0068] Figure 10 A schematic diagram of a dual-branch convolutional backbone network structure according to an embodiment of the present invention is shown;

[0069] Figure 11 A schematic diagram of a lightweight depthwise separable convolutional network structure according to an embodiment of the present invention is shown;

[0070] Figure 12 A block diagram of a directional modeling and dynamic attention network structure according to an embodiment of the present invention is shown;

[0071] Figure 13 A block diagram of the latitudinal slant angle regression model according to an embodiment of the present invention is shown;

[0072] Figure 14 A schematic diagram of the prediction results according to an embodiment of the present invention is shown;

[0073] Figure 15 A block diagram of a deep learning-based fabric skew detection apparatus according to an embodiment of the present invention is shown.

[0074] Figure 16 A schematic diagram of a device for detecting fabric skew based on deep learning according to an embodiment of the present invention is shown. Detailed Implementation

[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0076] According to embodiments of the present invention, a method, apparatus, and device for fabric weft skew detection based on deep learning are proposed. By fusing temporal texture and frequency domain directional features, and using a dynamic directional attention mechanism, the dominant weft direction in complex patterned fabrics can be effectively extracted. Even on complex jacquard fabrics, the weft angle can be accurately identified, solving the problem of easy prediction errors in complex patterns using traditional methods.

[0077] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.

[0078] Figure 1 This is a schematic flowchart of a deep learning-based fabric skew detection method according to an embodiment of the present invention. The method includes:

[0079] Step S01: Acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image through the affine transformation matrix to obtain the input image;

[0080] Step S02: Preprocess the input image to generate a time-domain image and a frequency-domain mask image;

[0081] Step S03: Input the time domain map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency domain orientation feature map representing the fabric, and then perform weighted fusion of the basic texture feature map and the frequency domain orientation feature map to obtain the fused feature map;

[0082] Step S04: Use a lightweight, deep separable convolutional network to generate enhanced feature maps from the fused features;

[0083] Step S05: Perform orientation modeling on the enhanced feature map to form a complete orientation feature map, and input the orientation feature map into the dynamic orientation attention module to generate a fixed-dimensional feature vector;

[0084] Step S06: Input the fixed-dimensional feature vector into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

[0085] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0086] To provide a clearer explanation of the deep learning-based fabric skew detection method described above, a specific embodiment will be used for illustration below. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation of the present invention.

[0087] The following concrete example will further illustrate the deep learning-based fabric skew detection method in more detail:

[0088] Step S01: Acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image through the affine transformation matrix to obtain the input image.

[0089] The specific steps are as follows:

[0090] Step S011: Acquire the original image of the fabric using an industrial camera and set the target weft skew angle. List, .

[0091] Step S012: Set the target latitude angle Convert to radian form And calculate the shear coefficient: Based on these coefficients, the affine transformation matrix is ​​constructed as follows: This allows for shearing along the latitude direction while keeping the longitude direction unchanged.

[0092] Step S013: Generate a new fabric image using an affine transformation matrix, expand the image canvas size using edge reflection filling to obtain a transformed image, and obtain image input samples from different angles for subsequent model training or prediction, such as... Figure 8 As shown.

[0093] Step S02: Preprocess the input image. The specific steps are as follows:

[0094] Step S021: Convert the input image to grayscale and scale it down. This ensures the consistency of input samples across spatial scales.

[0095] Step S022: Perform histogram equalization on the scaled image to improve overall contrast and enhance the visibility of latitude stripes, thus obtaining a time-domain image.

[0096] Step S023: Input the input image into the Fast Fourier Transform (FFT) module, and map the image from the spatial domain to the frequency domain using a two-dimensional FFT to obtain a complex frequency domain image; according to the image size Choose the square root normalization strategy and set the normalization factor to 1. This is used to suppress the size dependence of amplitude energy; a forward FFT operation is performed on the image to obtain the complex spectrum, and a DC component centering mode is adopted to move the low-frequency energy to the center of the spectrum, which facilitates the location of the main frequency information; the amplitude spectrum is obtained by taking the modulus of the complex spectrum to obtain the energy intensity of the frequency components in different directions; the amplitude spectrum is processed by logarithmic transformation and normalization (mapped to 0-255) to obtain the spectrogram, highlighting the significant directional frequency components;

[0097] Step S024: Binarize the spectrogram to generate a frequency domain mask of the texture features, and retain the core frequency information by center cropping, while removing edge redundancy and noise.

[0098] Step S025: Normalize the binarized frequency domain mask (map 0~255 to 0~1) for subsequent model feature extraction.

[0099] like Figure 9 The image shown is a schematic diagram of the input image preprocessing process.

[0100] Step S03: Input the time domain map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency domain orientation feature map representing the fabric. Then, perform weighted fusion of the basic texture feature map and the frequency domain orientation feature map to obtain the fused feature map.

[0101] Step S031: Input the temporal map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network, respectively, to obtain the spatial basic texture feature maps representing the overall texture distribution of the fabric. Frequency domain directional feature map reflecting the energy distribution of latitudinal direction and periodic texture. .

[0102] Step S032: By introducing learnable weight parameters , feature map and feature map Weighted fusion is performed to obtain the final fused feature map. :

[0103] .

[0104] This design preserves local texture details in the spatial domain features while enhancing the directional structure perception capability in the frequency domain features, thereby improving the model's adaptability and robustness to complex textured fabrics.

[0105] like Figure 10 As shown, both branches of the dual-branch convolutional backbone network consist of standard convolutional layers, deformable convolutional layers, and max-pooling layers. These layers are connected by BN layers and ReLU activation functions to enhance feature expressiveness and non-linear modeling. The default input feature dimension is... ,in The batch size is 384 in both height and width, with 1 channel. The kernel size of a standard convolutional layer is... The stride is 2, and the edge padding is 3. The kernel size of the deformable convolutional layer is... Step size is 1, edge fill is This is used to enhance the perception capability in the lateral direction. The kernel size of the max-pooling layer is... The step size is 2 and the edge padding is 1, which is used for feature downsampling to enhance the network's robustness to noise and reduce computation.

[0106] Specifically, the kernel size of a standard convolutional layer is The stride is 2, and the edge padding is 3. The kernel size of the deformable convolutional layer is... Step size is 1, edge fill is This is used to enhance the perception capability in the lateral direction. The kernel size of the max-pooling layer is... The step size is 2, and the edge fill is 1.

[0107] Alternatively, the kernel size of a standard convolutional layer is The stride is 2, and the edge padding is 3. The kernel size of the deformable convolutional layer is... With a stride of 1 and edge padding of 1, this layer enhances the model's adaptability to local deformations through learnable offsets. The kernel size of the max-pooling layer is... The step size is 2, and the edge fill is 1.

[0108] Alternatively, the kernel size of a standard convolutional layer is The stride is 1, and the edge padding is 2. The kernel size of the deformable convolutional layer is... Step size is 1, edge fill is This expands the lateral receptive field and enhances the lateral feature response. The kernel size of the max-pooling layer is... The step size is 2, and the edge fill is 1.

[0109] Alternatively, the kernel size of a standard convolutional layer is The stride is 1, and the edge padding is 2. The kernel size of the deformable convolutional layer is... The stride is 1, the edge padding is 1, and an orientation mask is introduced in the offset prediction to suppress offsets in irrelevant vertical directions, thus stabilizing orientation modeling. The kernel size of the average pooling layer is... The step size is 2, and the edge fill is 1.

[0110] Step S04: Use a lightweight, deep separable convolutional network to generate enhanced feature maps from the fused features.

[0111] Step S041: As Figure 11 As shown, the fused feature map of the input Each channel in the image is used for spatial feature extraction using a depthwise convolution with a kernel size of [size missing]. or or or or or Convolution operations are performed only within their respective channels, without changing the number of channels, which can effectively capture local texture and orientation information. Each channel of the convolution output is normalized (BN), and the ReLU activation function is applied to the normalized output to obtain the feature map.

[0112] Step S042: After integrating cross-channel information through convolution, the feature map obtained in step S041 is processed by BN layer and ReLU activation function to realize feature interaction and fusion between channels and generate an enhanced feature map. The size of the convolution kernel is or Alternatively, multi-scale parallel processing can be used. This operation allows for full sharing of information between different channels, enhancing the model's global perception of fabric texture structure.

[0113] Enhanced feature maps While preserving local spatial features, the feature map integrates global information between channels, providing an efficient and rich representation for subsequent latitudinal angle prediction.

[0114] By employing a lightweight, deeply separable convolutional network, the computational complexity of the model is significantly reduced while maintaining feature representation capabilities. This enables the model to efficiently process large-scale fabric image data, achieving the feasibility of online prediction. Actual testing shows that the inference time for a single image can reach 20–30 ms, meeting the high-speed inspection requirements of industrial production sites.

[0115] Step S05: Perform directional modeling on the enhanced feature map to form a complete directional feature map, and input the directional feature map into the dynamic directional attention module to generate a fixed-dimensional feature vector.

[0116] like Figure 12 The diagram shown illustrates the structure of directional modeling and dynamic attention networks. The specific steps are as follows:

[0117] Step S051: Enhance the feature map Multi-directional convolutional filtering is performed to generate response maps in different directions, where the convolution kernel directions are respectively... =(-30°, -15°, 0°, 15°, 30°), where each direction's convolutional kernel operates independently on the input feature map to extract texture features in the corresponding direction; max pooling and normalization are performed on the response map for each direction to extract local dominant direction features; and the features of each direction are arranged according to their spatial location to form a complete directional feature map. .

[0118] Step S052: Convert the orientation feature map The input attention generation network generates the attention weight matrix through convolutional layers and a sigmoid activation function. The convolution sum of the convolutional layers is . ; directional feature map Perform weighted processing:

[0119] ,

[0120] in, This indicates pixel-by-pixel multiplication. The feature map is after attention weighting;

[0121] The weights are dynamically adjusted to highlight the dominant latitude direction and suppress noise and interference information.

[0122] Step S053: Process the attention-weighted feature map Fixed-dimensional feature vectors are generated through convolutional layers, batch normalization (BN) layers, and ReLU activation. The kernel size of the convolution is 3×3 or or .

[0123] This step, through orientation modeling and dynamic attention mechanisms, can effectively capture the dominant orientation structure of fabric texture, enhance the model's ability to perceive complex fabric patterns, and provide accurate and reliable feature support for subsequent weft skew angle prediction.

[0124] Step S06: Input the fixed-dimensional feature vector into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

[0125] The latitudinal angle regression model consists of a global average pooling layer, several fully connected layers, and an activation function. In the network structure design, the last layer has no activation function.

[0126] In this embodiment, the latitudinal angle regression model consists of a global average pooling layer, a fully connected layer, a ReLU activation function, a fully connected layer, a ReLU activation function, and a fully connected layer, as follows: Figure 13 As shown.

[0127] The specific steps are as follows:

[0128] Step S061: For fixed-dimensional feature vectors Global Average Pooling (GAP) is performed to compress the spatial dimension into a global description vector with a channel dimension. This preserves global information about the fabric texture while reducing feature dimensions, making subsequent regression processing easier.

[0129] Step S062: Transfer the global feature vector The input is fed into a lightweight fully connected regression network, which, through several fully connected layers and activation functions, outputs the latitudinal angle. In the network architecture design, the last layer has no activation function, making the output a continuous value and achieving accurate regression. The regression yields the latitudinal angle. It can be directly used as a prediction value for the weft angle of the fabric, such as Figure 14 As shown.

[0130] Based on the same inventive concept, this invention also proposes a device for detecting fabric weft skew based on deep learning. The implementation of this device can be found in the implementation of the method described above; repeated details will not be repeated. Figure 15 As shown, the device 100 includes:

[0131] Expansion module 101: used to acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image through the affine transformation matrix to obtain the input image;

[0132] Preprocessing module 102: used to preprocess the input image to generate a time-domain image and a frequency-domain mask image;

[0133] Fusion module 103: is used to input the time domain map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network respectively to obtain the basic texture feature map and the frequency domain orientation feature map representing the fabric, and to perform weighted fusion of the basic texture feature map and the frequency domain orientation feature map to obtain the fused feature map;

[0134] Enhancement module 104: Used to generate enhanced feature maps from fused features using a lightweight, deep separable convolutional network;

[0135] Modeling module 105: Used to perform directional modeling on the enhanced feature map to form a complete directional feature map, and input the directional feature map into the dynamic directional attention module to generate a fixed-dimensional feature vector;

[0136] Prediction module 106: Used to input fixed-dimensional feature vectors into the weft slant angle regression model to predict the angle value of the weft thread of the fabric.

[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0138] like Figure 16As shown, the device includes a central processing unit (CPU), which can perform various appropriate actions and processes based on computer program instructions stored in read-only memory (ROM) or loaded from storage units into random access memory (RAM). The RAM can also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0139] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0140] The processing unit executes the various methods and processes described above, such as method steps S01 to S06. For example, in some embodiments, method steps S01 to S06 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of method steps S01 to S06 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute method steps S01 to S06 by any other suitable means (e.g., by means of firmware).

[0141] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.

[0142] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0143] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0144] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0145] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for detecting fabric skew based on deep learning, characterized in that, The method includes: Step S01: Acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image through the affine transformation matrix to obtain the input image; Step S02: Preprocess the input image to generate a time-domain image and a frequency-domain mask image; the specific steps are as follows: Step S021: Convert the input images to grayscale uniformly and scale them; Step S022: Perform histogram equalization on the scaled image to obtain the time-domain image; Step S023: Input the input image into the Fast Fourier Transform (FFT) module, and map the image from the spatial domain to the frequency domain using a two-dimensional FFT to obtain a complex frequency domain image; according to the image size Choose the square root normalization strategy and set the normalization factor to 1. Perform a forward FFT operation on the image to obtain a complex spectrum, and use a DC component centering mode to move low-frequency energy to the center of the spectrum; take the modulus of the complex spectrum to obtain the amplitude spectrum, and then perform logarithmic transformation and normalization on the amplitude spectrum to obtain the spectrum diagram. Step S024: Binarize the spectrogram to generate a frequency domain mask of texture features, and retain the core frequency information by center cropping; Step S025: Normalize the binarized frequency domain mask image numerically for subsequent model feature extraction; Step S03: Input the time domain map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency domain orientation feature map representing the fabric, and then perform weighted fusion of the basic texture feature map and the frequency domain orientation feature map to obtain the fused feature map; Step S04: Use a lightweight, deep separable convolutional network to generate an enhanced feature map from the fused feature map; Step S05: Perform directional modeling on the enhanced feature map to form a complete directional feature map, and input the directional feature map into the dynamic directional attention module to generate a fixed-dimensional feature vector; the specific steps are as follows: Step S051: Enhance the feature map Multi-directional convolutional filtering is performed to generate response maps in different directions; max pooling and normalization are then applied to the response maps in each direction; finally, the features in each direction are arranged according to their spatial location to form a complete directional feature map. ; Step S052: Convert the orientation feature map The input attention generation network generates the attention weight matrix through convolutional layers and a sigmoid activation function. ; directional feature map Perform weighted processing: , in, This indicates pixel-by-pixel multiplication. The feature map is after attention weighting; Step S053: Process the attention-weighted feature map Fixed-dimensional feature vectors are generated through convolutional layers, batch normalization (BN) layers, and ReLU activation. ; Step S06: Input the fixed-dimensional feature vector into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

2. The method for detecting fabric weft skew based on deep learning according to claim 1, characterized in that, The specific steps of step S01 are as follows: Step S011: Acquire raw images of the fabric using an industrial camera and set a list of target weft skew angles; Step S012: Convert the target latitude angle into radians and calculate the shear coefficient. Construct an affine transformation matrix based on this coefficient. Step S013: Generate a new fabric image through an affine transformation matrix, expand the image canvas size using edge reflection filling to obtain a transformed image, and obtain image input samples from different angles for subsequent model training or prediction.

3. The method for detecting fabric weft skew based on deep learning according to claim 1, characterized in that, The specific steps of step S03 are as follows: Step S031: Input the temporal map and the frequency domain mask map into the two branches of the dual-branch convolutional backbone network, respectively, to obtain the spatial basic texture feature maps representing the overall texture distribution of the fabric. Frequency domain directional feature map reflecting the energy distribution of latitudinal direction and periodic texture. ; Step S032: By introducing learnable weight parameters , feature map and feature map Weighted fusion is performed to obtain the final fused feature map. : 。 4. The method for detecting fabric weft skew based on deep learning according to claim 3, characterized in that, The two branches of the dual-branch convolutional backbone network consist of standard convolutional layers, deformable convolutional layers, and max pooling layers. The standard convolutional layers, deformable convolutional layers, and max pooling layers are connected by BN layers and ReLU activation functions.

5. The method for detecting fabric weft skew based on deep learning according to claim 1, characterized in that, The specific steps of step S04 are as follows: Step S041: Fusion feature map of the input Each channel in the process is used for spatial feature extraction using depthwise convolution. The output of each channel of the convolution is normalized, and the ReLU activation function is applied to the normalized output to obtain the feature map. Step S042: After integrating cross-channel information through convolution, the feature map obtained in step S041 is processed by a BN layer and a ReLU activation function to generate an enhanced feature map. .

6. The method for detecting fabric weft skew based on deep learning according to claim 1, characterized in that, The latitudinal angle regression model consists of a global average pooling layer, several fully connected layers, and an activation function. In the network structure design, the last layer has no activation function.

7. The method for detecting fabric weft skew based on deep learning according to claim 6, characterized in that, The specific steps of step S06 are as follows: Step S061: For fixed-dimensional feature vectors Perform global average pooling to compress the spatial dimension into a global description vector with a channel dimension. ; Step S062: Transfer the global feature vector The input is fed into a lightweight fully connected regression network, passing through several fully connected layers and activation functions, and outputs the latitudinal angle. .

8. A device for detecting fabric skewness based on deep learning, characterized in that, The device implements the method as described in any one of claims 1 to 7, comprising: The expansion module is used to acquire the original image of the fabric, set the target weft skew angle list, calculate the shear coefficient and construct the affine transformation matrix, and expand the original image to obtain the input image through the affine transformation matrix. Preprocessing module: Used to preprocess the input image, generating a time-domain image and a frequency-domain mask image; the specific steps are as follows: Step S021: Convert the input images to grayscale uniformly and scale them; Step S022: Perform histogram equalization on the scaled image to obtain the time-domain image; Step S023: Input the input image into the Fast Fourier Transform (FFT) module, and map the image from the spatial domain to the frequency domain using a two-dimensional FFT to obtain a complex frequency domain image; according to the image size Choose the square root normalization strategy and set the normalization factor to 1. Perform a forward FFT operation on the image to obtain a complex spectrum, and use a DC component centering mode to move low-frequency energy to the center of the spectrum; take the modulus of the complex spectrum to obtain the amplitude spectrum, and then perform logarithmic transformation and normalization on the amplitude spectrum to obtain the spectrum diagram. Step S024: Binarize the spectrogram to generate a frequency domain mask of texture features, and retain the core frequency information by center cropping; Step S025: Normalize the binarized frequency domain mask image numerically for subsequent model feature extraction; The fusion module is used to input the time-domain map and the frequency-domain mask map into the two branches of the dual-branch convolutional backbone network to obtain the basic texture feature map and the frequency-domain orientation feature map representing the fabric, and to perform weighted fusion of the basic texture feature map and the frequency-domain orientation feature map to obtain the fused feature map. Enhancement module: Used to generate enhanced feature maps from the fused feature maps using a lightweight, deep separable convolutional network; Modeling module: Used to perform directional modeling on the enhanced feature map to form a complete directional feature map, and input the directional feature map into the dynamic directional attention module to generate a fixed-dimensional feature vector; the specific steps are as follows: Step S051: Enhance the feature map Multi-directional convolutional filtering is performed to generate response maps in different directions; max pooling and normalization are then applied to the response maps in each direction; finally, the features in each direction are arranged according to their spatial location to form a complete directional feature map. ; Step S052: Convert the orientation feature map The input attention generation network generates the attention weight matrix through convolutional layers and a sigmoid activation function. ; directional feature map Perform weighted processing: , in, This indicates pixel-by-pixel multiplication. The feature map is after attention weighting; Step S053: Process the attention-weighted feature map Fixed-dimensional feature vectors are generated through convolutional layers, batch normalization (BN) layers, and ReLU activation. ; Prediction module: Used to input fixed-dimensional feature vectors into the weft skew angle regression model to predict the angle value of the weft thread of the fabric.

Citation Information

Patent Citations

  • Woven fabric weft skewing detection method

    CN103924432A

  • Fabric skew detection method based on image analysis

    CN110390675A