Clothing defect detection method and system based on multi-spectrum characteristic harmonic complex
By employing a multi-spectral feature harmonic convergence complex method, which combines spectral domain frequency division network, spectral harmonic convergence network, and edge spectrum complex network layers, the problem of low accuracy in garment defect detection is solved, achieving efficient and accurate defect detection.
Patent Information
- Application Number
- CN202511867854.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies have low accuracy in detecting garment defects, especially for dark-colored garments, small defects such as loose threads, and garments with complex prints. They also have high computational complexity, making it impossible to achieve timely, high-speed, and accurate real-time detection.
The method of multi-spectral feature harmonic convergence complex is adopted. By combining the spectral domain frequency division network layer, the spectral harmonic convergence network layer, the edge spectrum complex network layer and the target detection layer, frequency domain decomposition, resonant fusion, adaptive complex and structural enhancement are performed to generate feature representation with enhanced edge perception capability, and finally output the clothing defect detection result.
It improves the accuracy and efficiency of defect detection, solves the problem of blurred defect boundaries, and achieves efficient and accurate detection of garment defects.
Smart Images

Figure CN121981944A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of image detection, and more specifically, to a method and system for detecting clothing defects based on multi-spectral feature harmonic complexes. Background Technology
[0002] The textile industry is a pillar industry in my country. In the process of textile production, defective fabrics are inevitable. Garment defect detection is an indispensable part of the production process.
[0003] Traditional methods excel in feature recognition accuracy and detection speed; however, they still have limitations in certain defect detection scenarios. For example, traditional methods typically handle only a limited number of defect types, exhibiting poor accuracy when dealing with small defects such as those on dark-colored clothing or loose threads. Furthermore, they suffer from low stability when detecting defects in complex printed garments. For defects with complex textures and large scale ranges, the detection performance of traditional methods still has room for improvement. Moreover, traditional methods cannot achieve timely, high-speed, and accurate real-time detection.
[0004] Machine vision defect detection algorithms have made some progress in replacing manual inspection; however, existing network models have high computational complexity, high costs, and a limited scope of problems they can solve. With the continuous development of the textile industry, the types and processes of clothing are increasing, resulting in a large number of defects in textile products, varying in size, and often being small or highly concealed. However, existing defect detection technologies in the textile industry have limited detection range and cannot clearly, efficiently, and accurately identify all defects. Summary of the Invention
[0005] To address the issue of low accuracy in existing technologies for detecting garment defects, this invention proposes a method and system for detecting garment defects based on multi-spectral feature harmonic complexes, enabling efficient and accurate detection of garment defects in real-world engineering applications.
[0006] To achieve the above-mentioned technical effects, the technical solution of the present invention is as follows: A method for detecting garment defects based on multi-spectral feature harmonic complexes includes the following steps: The original clothing image data is acquired, and the acquired original clothing image data is preprocessed to obtain the clothing image to be detected. A multi-spectral feature harmonic clustering complex defect detection model is established and pre-trained. The multi-spectral feature harmonic clustering complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic clustering network layer, a side spectral complex network layer, and a target detection layer connected in sequence. The frequency domain decomposition and energy reconstruction of the deep features of the clothing image to be detected are performed using the spectral domain frequency division network layer, and multi-layer spectral representation is output. The spectral harmonic clustering network layer is used to perform resonant fusion and semantic enhancement on the multi-layer spectral representation, and output high-resolution aggregated features. The feature boundaries of the high-resolution aggregated features are adaptively complexed and structurally enhanced using a side-spectral complex network layer to generate feature representations with enhanced edge perception capabilities. Based on the feature representation with enhanced edge perception capabilities, the target detection output layer outputs the clothing defect detection results.
[0007] Preferably, the pretreatment includes: The defects in the original clothing image data are labeled to obtain the target detection dataset; The target image data in the target detection dataset is subjected to random flipping, rotation, shearing transformation and blending enhancement operations, and then normalized and scaled to obtain the clothing image to be detected.
[0008] Preferably, the spectral domain frequency division network layer includes a frequency filtering layer, a learnable frequency response layer, and a frequency band decomposition layer.
[0009] Preferably, the process of performing frequency domain decomposition and energy reconstruction is as follows: The image of the clothing to be detected is input into the frequency filtering layer, and the image features of the image of the clothing to be detected are analyzed by frequency to extract the spectral energy distribution information. The learnable frequency response layer is used to perform weighted modulation on different frequency components of the image, and the frequency response weights are adaptively adjusted according to the frequency domain energy intensity in the spectral energy distribution information to generate spectral modulation features. The spectral modulation features are input into the frequency band decomposition layer, and the spectral modulation features are divided into high-frequency components and low-frequency components according to a preset frequency threshold. The high-frequency components and low-frequency components are output separately to obtain multi-frequency feature sub-bands and obtain multi-layer spectral characterization.
[0010] Preferably, the spectral harmonic aggregation network layer includes a frequency attention layer, a guided aggregation layer, and a feature fusion layer.
[0011] Preferably, the process of resonant fusion and semantic enhancement is as follows: The high-frequency components are input into the frequency attention layer, where an attention mechanism is used to amplify the high-frequency components to obtain high-frequency attention features; the low-frequency components are input into the frequency attention layer, where global enhancement is performed to obtain low-frequency attention features. Based on the high-frequency attention features and the low-frequency attention features, the guided aggregation layer is used to perform weighted linear fusion of the multi-layer spectral representation to generate harmonic aggregation fusion features. The harmonic aggregation fusion feature is input into the feature fusion layer, and in the feature fusion layer, a high-resolution aggregation feature is output through multi-scale convolution and cross-layer connection mechanism.
[0012] Preferably, the edge spectrum complex network layer includes an edge sensing layer, a spectrum feedback layer, and a structural complex enhancement layer.
[0013] Preferably, the process of adaptive complexation and structural enhancement is as follows: The high-resolution aggregated features are input into the edge sensing layer to extract the boundary information of the high-resolution aggregated features and obtain an initial edge sensing map. Through the spectral feedback layer, feature feedback is performed between the spatial domain and the frequency domain, and the high-frequency components of the edges and the low-frequency components of the semantics in the initial edge perception map are interacted bidirectionally to repair the blurred boundaries and broken details. By utilizing the aforementioned structural complex enhancement layer, the high-resolution aggregated features are recursively updated in multiple steps through a learnable weighted gating mechanism to generate feature representations with enhanced edge perception capabilities.
[0014] Preferably, the target detection layer includes a feature prediction sublayer, a bounding box regression sublayer, and a category determination sublayer; the processing procedure of the target detection layer includes: The feature representation with enhanced edge perception capability is input into the feature prediction sub-layer, and the response features of the candidate target region are extracted through a multi-scale convolutional structure to generate a target candidate feature map. The target candidate feature map is input into the bounding box regression sub-layer. Based on the anchor box mechanism, the spatial position and size of the candidate target region are regressed and predicted to determine the bounding box coordinates of the defect region. The candidate target region is classified by the category determination sub-layer, the confidence distribution of each defect category is calculated, and the probability prediction result of each defect category is output. Non-maximum suppression is applied to the bounding box coordinates of the defective region and the confidence level of the defect category. The location coordinates of the defective region are then marked using the bounding box coordinates of the processed defective region. Output the defect detection results, including the location coordinates of the defect area, the defect category, and the confidence level of the defect category.
[0015] This invention also proposes a garment defect detection system based on multi-spectral feature harmonic complexes to implement the aforementioned garment defect detection method based on multi-spectral feature harmonic complexes. The system includes: The image acquisition and preprocessing module is used to acquire raw clothing image data, preprocess the acquired raw clothing image data, and obtain the clothing image to be detected. The model building module is used to establish and pre-train a multi-spectral feature harmonic complex defect detection model. The multi-spectral feature harmonic complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic network layer, a side spectral complex network layer, and a target detection layer connected in sequence. The feature decomposition module is used to perform frequency domain decomposition and energy reconstruction on the deep features of the clothing image to be detected using the spectral domain frequency division network layer, and output multi-layer spectral representation. The feature aggregation module is used to perform resonant fusion and semantic enhancement of the multi-layer spectral representation through the spectral resonant aggregation network layer, and output high-resolution aggregated features. The edge reconstruction module is used to adaptively reshape and structurally enhance the feature boundaries of the high-resolution aggregated features using the edge spectrum complex network layer, thereby generating a feature representation with enhanced edge perception capabilities. The defect detection module is used to perform target detection and classification on the feature representation with enhanced edge perception capability using the target detection layer, and output the defect detection result of the clothing image to be detected.
[0016] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention proposes a method and system for detecting clothing defects based on multi-spectral feature harmonic convergence complexes. The method establishes and pre-trains a multi-spectral feature harmonic convergence complex defect detection model, which includes a spectral domain frequency division network, a spectral harmonic convergence network, a side-spectral complex network, and a target detection output layer. The spectral domain frequency division network layer performs frequency domain decomposition and energy reconstruction on the deep features of the clothing image to be detected, outputting multi-layer spectral representations. This layer can divide deep features into high-frequency and low-frequency components to cover the feature requirements of different types of defects. The spectral harmonic convergence network layer performs resonant fusion and semantic enhancement on the multi-layer spectral representations, outputting high-resolution aggregated features. This enhances the semantic expressiveness and detail preservation of the features, providing higher-quality input for subsequent detection. The side-spectral complex network layer performs adaptive complexing and structural enhancement on the feature boundaries of the high-resolution aggregated features, generating feature representations with enhanced edge perception capabilities, improving the localization accuracy of defect boundaries and solving the problem of blurred defect boundaries. Based on the feature representations with enhanced edge perception capabilities, the target detection output layer outputs the clothing defect detection results. This invention solves the problems of difficulty in identifying clothing defects and low efficiency of manual inspection in actual production processes, and realizes efficient and accurate detection of clothing defects in real-world engineering application scenarios. Attached Figure Description
[0017] Figure 1 The flowchart illustrates a method for detecting clothing defects based on multi-spectral feature harmonic complexes proposed in this embodiment of the invention. Figure 2 This is a schematic diagram illustrating the structure used for high-frequency attention feature extraction as proposed in this embodiment of the invention. Figure 3 This is a schematic diagram illustrating the structure used for low-frequency attention feature extraction as proposed in this embodiment of the invention. Figure 4 A flowchart illustrating the generation of harmonic fusion features proposed in this embodiment of the invention; Figure 5 This diagram illustrates the overall workflow architecture for image processing as proposed in this embodiment of the invention. Figure 6 This diagram illustrates the structure of a garment defect detection system based on multi-spectral feature harmonic complex, as proposed in this embodiment of the invention. Detailed Implementation
[0018] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent. To better illustrate this embodiment, some parts of the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions; It is understandable to those skilled in the art that some well-known details may be omitted from the accompanying drawings.
[0019] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0020] The positional relationships depicted in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent. Example 1 This embodiment proposes a method for detecting garment defects based on multi-spectral feature harmonic complexes. (See [link to relevant documentation]). Figure 1 This includes the following steps: S1: Acquire raw clothing image data, preprocess the acquired raw clothing image data to obtain the clothing image to be detected; S2: Establish a multi-spectral feature harmonic complex defect detection model and perform pre-training. The multi-spectral feature harmonic complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic network layer, a side spectrum complex network layer, and a target detection layer connected in sequence. S3: The frequency domain decomposition and energy reconstruction of the deep features of the clothing image to be detected are performed using the spectral domain frequency division network layer, and the multi-layer spectral representation is output. S4: Utilize the spectral resonant network layer to resonantly fuse and semantically enhance the multi-layer spectral representations, and output high-resolution aggregated features; S5: Adaptive complexing and structural enhancement of the feature boundaries of high-resolution aggregated features are performed using the edge spectrum complex network layer to generate feature representations with enhanced edge perception capabilities; S6: Based on feature representation with enhanced edge perception capabilities, output clothing defect detection results through the target detection output layer.
[0021] In this embodiment, a multi-spectral feature harmonic complex defect detection model is established and pre-trained. The pre-training process can adopt hierarchical pre-training or multi-task joint pre-training. The key to pre-training lies in data relevance, task targeting, and subsequent fine-tuning and adaptation, which ultimately improves the model's accuracy in preserving high-frequency details, understanding low-frequency semantics, and locating edges of clothing defects.
[0022] This embodiment inputs the image of the garment to be detected into a multi-spectral feature harmonic composite defect detection model. A spectral domain frequency division network layer is used to divide deep features into high-frequency and low-frequency components to cover the feature requirements of different types of defects. While maintaining low computational complexity, the multi-frequency features are harmonicly fused and semantically enhanced to output high-resolution aggregated features, improving the semantic expressiveness and detail preservation of the features, providing higher-quality input for subsequent detection. Furthermore, an adaptive fusion mechanism improves feature expressiveness, while edge perception and spectral feedback mechanisms are used to adaptively reshape and structurally enhance feature boundaries for edge reconstruction, thereby achieving higher accuracy and robustness in the detection task. The method proposed in this embodiment solves the problems of difficult garment defect identification and low efficiency of manual inspection in actual production processes, achieving efficient and accurate detection of garment defects in real-world engineering applications.
[0023] Example 2 This embodiment further improves upon Embodiment 1 by providing a method for detecting clothing defects based on multi-spectral feature harmonic complexes. Specifically, the preprocessing operations used in preprocessing the acquired clothing image data include: The defects in the original clothing image data are labeled to obtain the target detection dataset; Random flipping, rotation, shearing transformation, and blending enhancement operations are performed on the target image data in the target detection dataset, followed by normalization and scaling to obtain the clothing image to be detected.
[0024] In this embodiment, the required clothing image dataset is obtained through on-site photography. Holes, knots, rough yarn, snags, and oil stains in the images are manually labeled to obtain the target detection dataset. The target image data in the target detection dataset is normalized and scaled, and then subjected to random flipping, rotation, shearing transformations, and blending enhancements to improve the model's robustness to varying scenes and different defect scales.
[0025] In one optional embodiment, the spectral domain frequency division network layer includes a frequency filtering layer, a learnable frequency response layer, and a frequency band decomposition layer. The process of frequency domain decomposition and energy reconstruction is as follows: The image of the clothing to be detected is input into the frequency filtering layer, and the image features of the clothing to be detected are analyzed by frequency to extract the spectral energy distribution information. A learnable frequency response layer is used to perform weighted modulation on different frequency components of the image. The frequency response weights are adaptively adjusted according to the frequency domain energy intensity in the spectral energy distribution information to generate spectral modulation features. The spectral modulation features are input into the frequency band decomposition layer. The spectral modulation features are divided into high-frequency components and low-frequency components according to the preset frequency threshold. The high-frequency components and low-frequency components are output separately to obtain multi-frequency feature sub-bands and obtain multi-layer spectral characterization.
[0026] In this embodiment, the Spectral Domain Frequency Division Network (SBSN) layer includes a frequency filtering layer, a learnable frequency response layer (LWD), and a frequency band decomposition layer (DWD). The SBSN performs frequency domain feature decomposition on the image to be detected. The process is as follows: The image to be detected is input into the frequency filtering layer, and the learnable convolutional kernel is used to perform frequency analysis on the image features to extract spectral energy distribution information. By using a learnable frequency response layer to perform weighted modulation on different frequency components, and adaptively adjusting the frequency response weights based on the frequency domain energy intensity, spectral modulation features are generated. The spectral modulation features are input into the frequency band decomposition layer, and the features are divided into high-frequency components and low-frequency components according to a set frequency threshold. The high-frequency components represent local texture, edges, and detailed structures, while the low-frequency components represent color distribution, brightness variations, and overall semantics. The calculation process satisfies the expression:
[0027] in, Indicates spectral modulation characteristics, For high-frequency components, Low-frequency components; High-frequency and low-frequency components are output separately as multi-frequency feature sub-bands, providing multi-level spectral characterization for subsequent feature fusion and structural enhancement.
[0028] In one optional embodiment, the spectral resonant aggregation network layer includes a frequency attention layer, a guided aggregation layer, and a feature fusion layer. The process of resonant fusion and semantic enhancement is as follows: High-frequency components are input into the frequency attention layer, where the attention mechanism is used to amplify the response of the high-frequency components to obtain high-frequency attention features; low-frequency components are input into the frequency attention layer to globally enhance the low-frequency components to obtain low-frequency attention features. Based on high-frequency and low-frequency attention features, a guided aggregation layer is used to perform weighted linear fusion of multi-layer spectral representations to generate harmonic aggregation fusion features. The harmonic aggregation features are input into the feature fusion layer. In the feature fusion layer, high-resolution aggregated features are output through multi-scale convolution and cross-layer connection mechanisms.
[0029] In this embodiment, the Spectral Harmony Convergence Network (SHAN) layer includes a Frequency Attention Layer (FA), a Guided Convergence Layer (GFA), and a Feature Fusion Layer. The SHAN layer performs multi-scale feature extraction and resonant feature fusion on the multi-frequency features output by the spectral domain frequency division network. The process is as follows: See [link to documentation]. Figure 2 The high-frequency components are input into the high-frequency attention layer (HFA), and a residual block ResB is applied for texture preservation. Through a joint channel attention and spatial attention mechanism (JA), the responses of texture abrupt changes and salient edge regions are amplified to obtain high-frequency attention features. The calculation process satisfies the expression:
[0030] in, Indicates high-frequency attention characteristics; See Figure 3 The low-frequency components are input into a low-frequency attention layer (LFA). The decomposed low-frequency features are processed using residual blocks with instance-normalized ResIN. Normalization (PN) and global semantic modulation are then performed through a convolutional neural network (ConvNet) to globally enhance brightness, color, and structural information, resulting in low-frequency attention features. The calculation process satisfies the expression:
[0031] in, This indicates low-frequency attentional characteristics; like Figure 4 As shown, based on high-frequency attention features and low-frequency attention features, the multi-frequency features are weighted and linearly fused by the guided aggregation layer, so that high-level semantics and low-level details work together in the spatial domain to generate harmonious aggregation fusion features. The resonant clustered features are input into the feature fusion layer. Through multi-scale convolution and cross-layer connection mechanisms, resonant interaction of frequency information and resolution enhancement are achieved, outputting high-resolution clustered features with global semantic consistency and clarity of local texture details. The calculation process satisfies the expression:
[0032] in, This indicates high-resolution aggregation features.
[0033] In one optional embodiment, the edge-spectral complex network layer includes an edge-aware layer, a spectral feedback layer, and a structural complex enhancement layer. The process of adaptive complex and structural enhancement is as follows: The high-resolution aggregated features are input into the edge sensing layer to extract the boundary information of the high-resolution aggregated features and obtain the initial edge sensing map. Through the spectral feedback layer, feature feedback is performed between the spatial and frequency domains, and the high-frequency components of the edges and the low-frequency components of the semantics in the initial edge perception map are interacted bidirectionally to repair the blurred boundaries and broken details. By utilizing a structural complex enhancement layer, a learnable weighted gating mechanism is used to perform multi-step recursive updates on high-resolution aggregated features, generating feature representations with enhanced edge awareness capabilities.
[0034] In this embodiment, the Edge-Spectral Complex Network (ESRN) layer includes an Edge-Aware Layer (RRS), a Spectral Feedback Layer, and a Structure-Enhancing Layer (OER). The ESRN performs boundary adaptive complexing and structure enhancement on high-resolution aggregated features. The process is as follows: High-resolution aggregated features are input into the edge sensing layer, and gradient operators and directional convolutions are used to extract the boundary information of the high-resolution aggregated features to form an initial edge sensing map. By using a spectral feedback layer to perform feature feedback between the spatial and frequency domains, the high-frequency components of the edges and the low-frequency components of the semantics in the initial edge perception map can interact bidirectionally to repair areas with blurred boundaries and broken details. By utilizing a structural complex enhancement layer, a learnable weighted gating mechanism is used to recursively update the fused features in multiple steps, gradually enhancing local structural details while maintaining global consistency, thus generating edge-enhanced features. The edge enhancement features are output as complex feature representations, which have enhanced edge discrimination capabilities and structural continuity, and are used for subsequent defect localization and accurate detection.
[0035] In an optional embodiment, the object detection layer includes a feature prediction sublayer, a bounding box regression sublayer, and a category determination sublayer; the processing steps of the object detection layer include: The feature representation with enhanced edge perception capability is input into the feature prediction sub-layer, and the response features of the candidate target region are extracted through a multi-scale convolutional structure to generate a target candidate feature map. The target candidate feature map is input into the bounding box regression sub-layer. Based on the anchor box mechanism, the spatial location and size of the candidate target region are regressed and predicted to determine the bounding box coordinates of the defect region. The candidate target region is classified by feature classification using the category determination sub-layer, the confidence distribution of each defect category is calculated, and the probability prediction result of each defect category is output. Non-maximum suppression is applied to the bounding box coordinates of the defective region and the confidence level of the defective category. The location coordinates of the defective region are then marked using the bounding box coordinates of the processed defective region. Output the defect detection results, including the location coordinates of the defect area, the defect category, and the confidence level of the defect category.
[0036] In this embodiment, the confidence distribution of each defect category is calculated based on the Softmax activation function; non-maximum suppression (NMS) is applied to the bounding box coordinates of the defect area and the confidence of the defect category; and a detection result map containing the location coordinates of the defect area, the defect category and the confidence of the defect category is output, so as to realize the automatic identification and accurate positioning of multiple defects such as holes, stains, knots and rough yarn on the garment surface.
[0037] Furthermore, such as Figure 5 As shown, the input image undergoes progressive processing through three network layers proposed in this embodiment, ultimately outputting a result image. The three network layers are the Spectral Domain Frequency Division Network Layer (SBSN), the Spectral Harmonization Network Layer (SHAN), and the Edge Spectral Complex Network Layer (ESRN). First, the image features are... The learned frequency response layer (LWD) of the spectral domain frequency division network is input to obtain the spectral modulation features. The frequency band decomposition (DWD) layer of the spectral domain frequency division network is input to obtain the high-frequency components. and low frequency components The high-frequency and low-frequency components are then input into the frequency attention layer (FA) of the spectral harmonic convergence network layer to obtain the high-frequency attention features. and low-frequency attention features The input is then fed into the Guided Aggregation Layer (GFA) to obtain high-resolution aggregated features. High-resolution aggregated features are input into the edge-aware layer (RRS) of the edge spectrum complex network layer to obtain high semantic segmentation features. The edge features are then input into the Structure Complex Enhancement Layer (OER) to obtain the edge features. Finally, the output image is displayed.
[0038] Example 3 This embodiment proposes a garment defect detection system based on multi-spectral feature harmonic convergence complexes. (See [link to documentation]). Figure 6 ,include: The image acquisition and preprocessing module is used to acquire raw clothing image data, preprocess the acquired raw clothing image data, and obtain the clothing image to be detected. The model building module is used to build and pre-train a multi-spectral feature harmonic complex defect detection model. The multi-spectral feature harmonic complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic network layer, a side spectrum complex network layer, and a target detection layer connected in sequence. The feature decomposition module is used to perform frequency domain decomposition and energy reconstruction on the deep features of the clothing image to be detected using the spectral domain frequency division network layer, and output multi-layer spectral representation. The feature aggregation module is used to resonantly fuse and semantically enhance multi-layer spectral representations through a spectral resonant aggregation network layer, and output high-resolution aggregated features. The edge reconstruction module is used to adaptively reshape and structurally enhance the feature boundaries of high-resolution aggregated features using the edge spectrum complex network layer, generating feature representations with enhanced edge perception capabilities. The defect detection module is used to perform target detection and classification on feature representations with enhanced edge perception capabilities using the target detection layer, and outputs the defect detection results of the clothing image to be detected.
[0039] In this embodiment, the spectral domain frequency division network layer of the feature decomposition module divides deep features into high-frequency and low-frequency components to cover the feature requirements of different types of defects. The high-frequency components represent local texture, edges, and detailed structures, while the low-frequency components represent color distribution, brightness variations, and overall semantics. The spectral harmonic convergence network layer of the feature aggregation module performs resonant fusion and semantic enhancement on the multi-layer spectral representations, enhancing the semantic expression and detail preservation of the features. The edge-spectral complex network layer of the edge reconstruction module improves the localization accuracy of defect boundaries, solving the problem of blurred defect boundaries. This embodiment, by constructing a complete garment defect detection system, solves the problems of difficult identification of garment defects and low efficiency of manual inspection in the actual production process of the textile industry, achieving efficient and accurate detection of garment defects in real-world engineering application scenarios.
[0040] The embodiments described are merely examples to clearly illustrate the present invention and are not intended to limit the implementation of the invention. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively describe all possible implementations. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting garment defects based on multi-spectral feature harmonic complexes, characterized in that, Includes the following steps: The original clothing image data is acquired, and the acquired original clothing image data is preprocessed to obtain the clothing image to be detected. A multi-spectral feature harmonic clustering complex defect detection model is established and pre-trained. The multi-spectral feature harmonic clustering complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic clustering network layer, a side spectral complex network layer, and a target detection layer connected in sequence. The frequency domain decomposition and energy reconstruction of the deep features of the clothing image to be detected are performed using the spectral domain frequency division network layer, and multi-layer spectral representation is output. The spectral harmonic clustering network layer is used to perform resonant fusion and semantic enhancement on the multi-layer spectral representation, and output high-resolution aggregated features. The feature boundaries of the high-resolution aggregated features are adaptively complexed and structurally enhanced using a side-spectral complex network layer to generate feature representations with enhanced edge perception capabilities. Based on the feature representation with enhanced edge perception capabilities, the target detection output layer outputs the clothing defect detection results.
2. The method for detecting garment defects based on multi-spectral feature harmonic convergence complex according to claim 1, characterized in that, The preprocessing includes: The defects in the original clothing image data are labeled to obtain the target detection dataset; The target image data in the target detection dataset is subjected to random flipping, rotation, shearing transformation and blending enhancement operations, and then normalized and scaled to obtain the clothing image to be detected.
3. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 1, characterized in that, The spectral domain frequency division network layer includes a frequency filtering layer, a learnable frequency response layer, and a frequency band decomposition layer.
4. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 3, characterized in that, The process of frequency domain decomposition and energy reconstruction is as follows: The image of the clothing to be detected is input into the frequency filtering layer, and the image features of the image of the clothing to be detected are analyzed by frequency to extract the spectral energy distribution information. The learnable frequency response layer is used to perform weighted modulation on different frequency components of the image, and the frequency response weights are adaptively adjusted according to the frequency domain energy intensity in the spectral energy distribution information to generate spectral modulation features. The spectral modulation features are input into the frequency band decomposition layer, and the spectral modulation features are divided into high-frequency components and low-frequency components according to a preset frequency threshold. The high-frequency components and low-frequency components are output separately to obtain multi-frequency feature sub-bands and obtain multi-layer spectral characterization.
5. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 4, characterized in that, The spectral harmonic aggregation network layer includes a frequency attention layer, a guided aggregation layer, and a feature fusion layer.
6. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 5, characterized in that, The process of resonant fusion and semantic enhancement is as follows: The high-frequency components are input into the frequency attention layer, where an attention mechanism is used to amplify the high-frequency components to obtain high-frequency attention features. The low-frequency components are input into the frequency attention layer, and the low-frequency components are globally enhanced to obtain low-frequency attention features. Based on the high-frequency attention features and the low-frequency attention features, the guided aggregation layer is used to perform weighted linear fusion of the multi-layer spectral representation to generate harmonic aggregation fusion features. The harmonic aggregation fusion feature is input into the feature fusion layer, and in the feature fusion layer, a high-resolution aggregation feature is output through multi-scale convolution and cross-layer connection mechanism.
7. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 1, characterized in that, The edge spectrum complex network layer includes an edge sensing layer, a spectrum feedback layer, and a structural complex enhancement layer.
8. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 7, characterized in that, The process of adaptive complexation and structural enhancement is as follows: The high-resolution aggregated features are input into the edge sensing layer to extract the boundary information of the high-resolution aggregated features and obtain an initial edge sensing map. Through the spectral feedback layer, feature feedback is performed between the spatial domain and the frequency domain, and the high-frequency components of the edges and the low-frequency components of the semantics in the initial edge perception map are interacted bidirectionally to repair the blurred boundaries and broken details. By utilizing the aforementioned structural complex enhancement layer, the high-resolution aggregated features are recursively updated in multiple steps through a learnable weighted gating mechanism to generate feature representations with enhanced edge perception capabilities.
9. The method for detecting garment defects based on multi-spectral feature harmonic complex according to claim 1, characterized in that, The target detection layer includes a feature prediction sublayer, a bounding box regression sublayer, and a category determination sublayer; the processing procedure of the target detection layer includes: The feature representation with enhanced edge perception capability is input into the feature prediction sub-layer, and the response features of the candidate target region are extracted through a multi-scale convolutional structure to generate a target candidate feature map. The target candidate feature map is input into the bounding box regression sub-layer. Based on the anchor box mechanism, the spatial position and size of the candidate target region are regressed and predicted to determine the bounding box coordinates of the defect region. The candidate target region is classified by the category determination sub-layer, the confidence distribution of each defect category is calculated, and the probability prediction result of each defect category is output. Non-maximum suppression is applied to the bounding box coordinates of the defective region and the confidence level of the defect category. The location coordinates of the defective region are then marked using the bounding box coordinates of the processed defective region. Output the defect detection results, including the location coordinates of the defect area, the defect category, and the confidence level of the defect category.
10. A garment defect detection system based on multi-spectral feature harmonic complex, used to implement the garment defect detection method based on multi-spectral feature harmonic complex as described in claim 1, characterized in that, include: The image acquisition and preprocessing module is used to acquire raw clothing image data, preprocess the acquired raw clothing image data, and obtain the clothing image to be detected. The model building module is used to establish and pre-train a multi-spectral feature harmonic complex defect detection model. The multi-spectral feature harmonic complex defect detection model includes a spectral domain frequency division network layer, a spectral harmonic network layer, a side spectral complex network layer, and a target detection layer connected in sequence. The feature decomposition module is used to perform frequency domain decomposition and energy reconstruction on the deep features of the clothing image to be detected using the spectral domain frequency division network layer, and output multi-layer spectral representation. The feature aggregation module is used to perform resonant fusion and semantic enhancement of the multi-layer spectral representation through the spectral resonant aggregation network layer, and output high-resolution aggregated features. The edge reconstruction module is used to adaptively reshape and structurally enhance the feature boundaries of the high-resolution aggregated features using the edge spectrum complex network layer, thereby generating a feature representation with enhanced edge perception capabilities. The defect detection module is used to perform target detection and classification on the feature representation with enhanced edge perception capability using the target detection layer, and output the defect detection result of the clothing image to be detected.