Textile defect detection method and system based on machine vision

Through the multi-classification support vector machine method in machine vision technology, combined with grayscale symbiosis processing and spectrum change recognition module, the problem of traditional textile defect detection methods being unable to identify subtle defects and unstable detection is solved, and the textile defects are realized High accuracy and stability detection.

CN119205749AInactive Publication Date: 2024-12-27ZHEJIANG CHANGXING HAOGE TEXTILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411698064.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional textile defect detection methods cannot fully extract textile texture characteristics, resulting in difficulty in identifying subtle or complex defects, lack of self-optimization ability, and unstable detection effect.

Method used

Using a multi-classification support vector machine method based on machine vision, branches and defect detection mapping branches are mined through stacked texture descriptions, combined with grayscale symbiosis processing module and spectrum change recognition module, the texture description vector of textile images is obtained and mapped. Optimize algorithm variables to improve detection accuracy.

Benefits of technology

It realizes effective identification of different types of defects, improves the accuracy and reliability of inspection, adapts to the inspection needs of different textiles, and ensures the quality of textiles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205749A_ABST
    Figure CN119205749A_ABST
Patent Text Reader

Abstract

The invention discloses a textile defect detection method and system based on machine vision, and belongs to the technical field of machine vision. The texture description mining branch and the defect detection mapping branch structure stacked in the multi-classification support vector machine can comprehensively and deeply process the textile fabric image. The p texture description mining branches carry out texture recognition through a gray level co-occurrence processing module and a frequency spectrum change recognition module, and texture features are mined from multiple dimensions to ensure the comprehensiveness and accuracy of texture description. The same modules of the q flaw detection mapping branches are arranged for mapping processing, so that texture features can be effectively converted into flaw detection related features, the detection capability of different types of flaws can be improved, and flaws such as tiny stains, broken holes and chromatic aberration can be effectively identified. The accuracy and reliability of detection can be improved by comparing flaw classification authentication information and discrimination information to optimize algorithm variables, the detection requirements of various textile fabrics are met, and the quality of the textile fabrics is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of machine vision technology, and specifically relates to a method and system for detecting textile defects based on machine vision. Background Art

[0002] In the textile industry, textile quality inspection is of vital importance, and defect detection is a key link. Traditional textile defect detection methods have many problems. On the one hand, the detection method often cannot fully extract the texture features of the textile, and cannot analyze the textile surface from multiple levels and angles, resulting in difficulty in accurately identifying some subtle or complex defects. For example, for some defects that are subtly related to texture changes, traditional methods may miss or misjudge. On the other hand, the lack of an effective feature conversion mechanism cannot well convert texture features into features directly related to defect detection, affecting the accuracy of defect detection. In addition, traditional detection methods lack the ability to self-optimize. Once the detection rules or algorithms are set, it is difficult to adjust according to the actual detection results. When facing different types of textiles or textiles from different production batches, the detection effect is unstable. Summary of the invention

[0003] The present application provides a method and system for detecting textile defects based on machine vision, which can solve or partially solve the technical problems involved in the above-mentioned background technology.

[0004] The embodiment of the present application provides a method for detecting textile defects based on machine vision, the method is implemented by a textile defect detection device through a multi-classification support vector machine, the multi-classification support vector machine includes p stacked texture description mining branches and q stacked defect detection mapping branches, each of the texture description mining branches and each of the defect detection mapping branches includes a stacked grayscale symbiosis processing module and a spectrum change recognition module, p is a positive integer not less than 2, q is a positive integer not less than 3, the method includes: acquiring a textile CMOS surface image, and inputting the textile CMOS surface image into the p texture description mining branches, performing texture recognition in turn through each of the p texture description mining branches, and obtaining a surface texture description vector generated by the p texture description mining branches; wherein each of the texture description mining branches is used to perform texture vector refinement in turn through the grayscale symbiosis processing module and the spectrum change recognition module, so as to obtain a surface texture description vector generated by the p texture description mining branches; wherein each of the texture description mining branches is used to perform texture vector refinement in turn through the grayscale symbiosis processing module and the spectrum change recognition module, so as to obtain a surface texture description vector generated by the p texture description mining branches; wherein and processing the texture vector extraction result of the texture description mining branch through the feature transfer indication of the initial module node and the terminal module node of the grayscale symbiosis processing module; inputting the surface texture description vector into the q defect detection mapping branches, and performing mapping processing in turn through each of the q defect detection mapping branches to obtain the defect detection mapping vector generated by the q defect detection mapping branches; wherein each of the defect detection mapping branches is used to perform spatial vector transformation in turn through the grayscale symbiosis processing module and the spectrum change recognition module, and processing the spatial vector transformation result of the defect detection mapping branch through the feature transfer indication; predicting the defect classification discrimination information of the textile CMOS surface image based on the defect detection mapping vector; optimizing the algorithm variables of the multi-classification support vector machine based on the difference between the defect classification authentication information of the textile CMOS surface image and the defect classification discrimination information.

[0005] An embodiment of the present application provides a textile defect detection device, comprising at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the above method.

[0006] An embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the above method are implemented.

[0007] In the embodiment of the present application, firstly, the stacked texture description mining branch and defect detection mapping branch structure in the multi-classification support vector machine can process textile images comprehensively and deeply. The p texture description mining branches (p≥2) perform texture recognition through the grayscale co-occurrence processing module and the spectrum change recognition module, and mine texture features from multiple dimensions to ensure the comprehensiveness and accuracy of the texture description. The q defect detection mapping branches (q≥3) perform mapping processing with the same module setting, which can effectively convert texture features into defect detection related features. This structure helps to improve the detection ability of different types of defects, whether it is tiny stains, holes or color differences. Defects can be effectively identified. By comparing the defect classification authentication information and the discrimination information to optimize the algorithm variables, the detection system can continuously improve itself, improve the accuracy and reliability of detection, adapt to the detection needs of various textiles, and ensure the quality of textiles. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A flowchart of a method for detecting textile defects based on machine vision provided in an embodiment of the present application.

[0009] Figure 2 A schematic structural diagram of a textile defect detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0010] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0011] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, in this application, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0012] Figure 1A method for detecting textile defects based on machine vision is shown. The method is implemented by a textile defect detection device through a multi-classification support vector machine. The multi-classification support vector machine includes p stacked texture description mining branches and q stacked defect detection mapping branches. Each of the texture description mining branches and each of the defect detection mapping branches includes a stacked grayscale symbiosis processing module and a spectrum change recognition module. p is a positive integer not less than 2, and q is a positive integer not less than 3. Based on this, the method includes the following steps 202-206.

[0013] Step 202: Acquire a textile CMOS surface image, and input the textile CMOS surface image into the p texture description mining branches, perform texture recognition in turn through each of the p texture description mining branches, and obtain a surface texture description vector generated by the p texture description mining branches.

[0014] Among them, each of the texture description mining branches is used to extract texture vectors through the grayscale symbiosis processing module and the spectrum change recognition module in sequence, and to process the texture vector extraction results of the texture description mining branch through the feature transfer indications of the initial module node and the terminal module node of the grayscale symbiosis processing module.

[0015] Step 204: input the surface texture description vector into the q defect detection mapping branches, and perform mapping processing in sequence through each of the q defect detection mapping branches to obtain the defect detection mapping vectors generated by the q defect detection mapping branches.

[0016] Each of the defect detection mapping branches is used to perform space vector transformation in sequence through the grayscale symbiosis processing module and the spectrum change identification module, and to process the space vector transformation result of the defect detection mapping branch through the feature transfer indication.

[0017] Step 206: predicting the defect classification information of the textile CMOS surface image based on the defect detection mapping vector; and optimizing the algorithm variables of the multi-classification support vector machine based on the difference between the defect classification authentication information of the textile CMOS surface image and the defect classification information.

[0018] In the actual application of the present application, the entire detection process involves multiple complex modules and operation processes. First, in step 202, the device acquires a textile CMOS surface image. For example, the CMOS camera may have a resolution of 1920×1080, which can clearly capture the details of the textile surface. The acquired textile CMOS surface image is then input into p texture description mining branches.

[0019] Each texture description mining branch has a specific processing flow. The grayscale symbiosis processing module plays an important role. Take a specific textile defect detection as an example. For example, the texture of cotton textiles has certain regularities. The grayscale symbiosis processing module analyzes the pixels in the image, such as the frequency of co-occurrence of pixels of different gray levels in a 5×5 pixel neighborhood. For the spectrum change recognition module, it may identify changes in specific frequency bands in the image spectrum. For example, a normal textile texture may have a stable energy distribution in certain frequency bands of the spectrum, while when there are defects, the energy distribution of these frequency bands will change.

[0020] In each texture description mining branch, the grayscale symbiosis processing module has an initial module node and an end module node, and the texture vector extraction results are processed through the feature transfer instructions of these two nodes. The initial module node may set some basic texture feature extraction parameters, such as the initial setting of the grayscale range to 8 levels between 0-255. The end module node is further optimized and adjusted according to the settings of the initial node and the intermediate processing results. In this way, each texture description mining branch can perform texture recognition in turn, and finally obtain the surface texture description vector generated by p texture description mining branches.

[0021] Then proceed to step 204, and input the previously obtained surface texture description vector into q defect detection mapping branches. Each defect detection mapping branch also has a unique processing logic. The grayscale symbiosis processing module and the spectrum change recognition module in the defect detection mapping branch play a role again. For example, in the process of spatial vector transformation, for the texture-related vectors previously obtained from the texture description mining branch, the grayscale symbiosis processing module re-analyzes the changes in texture features at a new pixel analysis scale (such as a 3×3 pixel neighborhood), which helps to further extract features related to defects. The spectrum change recognition module may set different spectral key area focus ranges according to different textile types (such as silk, linen, etc.). For example, for silk textiles, more attention is paid to subtle changes in the high-frequency spectrum, because the texture of silk is delicate, and defects are often more obviously reflected in the high-frequency spectrum.

[0022] After processing the spatial vector transformation result of the defect detection mapping branch through the feature transfer indication, each defect detection mapping branch can be mapped in turn to obtain the defect detection mapping vectors generated by q defect detection mapping branches.

[0023] Finally, in step 206, the defect classification discrimination information of the textile CMOS surface image is predicted based on the defect detection mapping vector obtained previously. For example, if the defect detection mapping vector is within a certain numerical range or vector space region, it is determined to be a certain type of defect. For example, when the value of a certain component of the defect detection mapping vector is between 0-0.3, it is determined to be a stain defect on the textile surface; when it is between 0.3-0.6, it is determined to be a hole defect, etc. At the same time, the device will obtain the defect classification authentication information of the textile CMOS surface image. This authentication information may be accurate classification information obtained by performing a large amount of analysis and marking of textile samples of known defect types. Then compare the difference between the defect classification authentication information and the defect classification discrimination information. If there is a difference, the algorithm variables of the multi-classification support vector machine will be optimized.

[0024] In terms of multi-classification support vector machines, a scenario of textile defect classification can be considered, for example, there are 4 types of defects (stains, holes, broken threads, color difference) plus normal textiles, a total of 5 categories. The multi-classification support vector machine may use a one-vs-rest strategy to construct 5 binary classification support vector machines. When it is found that there is a difference between the defect classification discrimination information and the authentication information, for example, in the judgment of hole defects, the discrimination information is misjudged as a stain defect, it is necessary to adjust the relevant variables of the support vector machine. The parameters of the hyperplane may be adjusted, such as for the support vector machine using a linear kernel function, some component values ​​of the normal vector of the hyperplane are adjusted. If the support vector machine uses a radial basis function (RBF) kernel, the value of the parameter γ in the RBF kernel function is adjusted. For example, if a classification error occurs when γ=0.5, try to adjust γ to 0.3 or 0.7, and then reprocess the textile CMOS surface image. Through continuous adjustment and optimization, the accuracy of the textile defect detection device in classifying textile defects is improved.

[0025] The workflow of the entire textile defect detection device is an interrelated and progressive process. From the initial acquisition of textile CMOS surface images, to the extraction of texture features through the texture description mining branch, to the further processing of the defect detection mapping branch, and finally to the optimization of defect classification and multi-classification support vector machine algorithm variables, each link is closely coordinated to accurately detect defects on the textile surface and meet the detection needs of different types of textiles and various defect types.

[0026] In the process of processing different textiles, the textile defect detection device needs to constantly adapt to the diversity of textiles. For example, when detecting coarse linen textiles, due to their rough and irregular texture, the grayscale symbiosis processing module in the texture description mining branch may need to use a larger pixel neighborhood range, such as 7×7 or even 9×7 to accurately extract texture features. For worsted wool textiles, the spectrum change recognition module needs to divide the spectrum interval more finely to capture the delicate texture change characteristics unique to wool textiles. In the defect detection mapping branch, the defect characteristics of different textiles also need to be adjusted accordingly. For example, for the broken thread defect on linen textiles, it may be necessary to focus on the changes in the texture direction characteristics during the spatial vector transformation process, because the texture directionality of linen textiles is relatively obvious, and the broken thread will cause a sudden change in the texture direction. For the color difference defects of wool textiles, the spatial vector transformation process needs to consider more about the embodiment of color-related features in the vector, which can be achieved by adjusting the analysis weight of the grayscale symbiosis processing module on the color channel.

[0027] When it comes to the comparison of defect classification discrimination information and defect classification certification information and the optimization of multi-classification support vector machine algorithm variables, this is a process of continuous improvement. Taking the actual production inspection of a textile factory as an example, when producing different batches of textiles, factors such as the raw materials and production processes of the textiles may change, resulting in different characteristics of the defects. For example, a new batch of cotton textiles uses new dyes, which may affect the manifestation of color difference defects. The initial multi-classification support vector machine may have inaccurate classification. By comparing the defect classification discrimination information and the accurate defect classification certification information, it is found that the misjudgment rate of color difference defects is high. At this time, for the multi-classification support vector machine using a polynomial kernel function, the parameters such as the degree of the polynomial can be adjusted. If the initial polynomial degree is 2 and the misjudgment rate is high, try to adjust the degree to 3 or 4, retrain the multi-classification support vector machine, and then detect the textile CMOS surface image again until a satisfactory defect classification accuracy is achieved.

[0028] In the textile defect detection device, the data transfer and processing between the modules also need to be optimized. For example, in the process of data transfer from the texture description mining branch to the defect detection mapping branch, the surface texture description vector needs to be reasonably formatted and standardized. If the numerical ranges of the components of the surface texture description vector are very different, it may affect the processing effect of the defect detection mapping branch. For example, if the numerical range of some components is between 0-1, while others are between 0-100, normalization processing is required to unify the numerical values ​​of all components into a suitable range, such as between 0-1. This ensures that the grayscale symbiosis processing module and the spectrum change recognition module in the defect detection mapping branch can be processed according to a unified standard, thereby improving the accuracy and stability of the entire device for textile defect detection.

[0029] In the actual textile production process, the textile defect detection device needs to meet the requirements of efficient detection. For example, if the production speed of textiles is 10 meters per minute, then the textile defect detection device needs to complete the acquisition, processing and defect classification and discrimination of each section of textile surface image in a very short time. This requires that the algorithm processing efficiency in each texture description mining branch and defect detection mapping branch is high. For example, in the grayscale co-occurrence processing module in the texture description mining branch, parallel computing can be used to improve the processing speed. For a 1920×1080 resolution textile CMOS surface image, the image can be divided into multiple sub-regions, and the grayscale co-occurrence matrix of these sub-regions is calculated at the same time, and then the results are summarized. Similarly, in the defect detection mapping branch, a similar parallel processing strategy can also be adopted to ensure that it can keep up with the production speed of textiles and detect defects on the textile surface in a timely and accurate manner.

[0030] The textile defect detection device also needs to consider the detection effect under different lighting conditions. When collecting textile CMOS surface images, changes in lighting conditions may affect the performance of image texture and defect features. For example, under strong light illumination, some subtle textures on the textile surface may be masked, while under weak light illumination, defects may not be easily found. To solve this problem, the textile defect detection device can adopt adaptive lighting compensation technology. In the texture description mining branch, the grayscale symbiosis processing module and the spectrum change recognition module can adjust relevant parameters according to changes in lighting conditions. For example, under weak light conditions, the grayscale symbiosis processing module can appropriately reduce the sensitivity threshold of grayscale differences to better extract texture features; the spectrum change recognition module can enhance the focus on low-frequency spectrum, because the low-frequency spectrum under weak light may contain more information related to defects. In the defect detection mapping branch, the relevant parameters of the space vector transformation can also be adjusted according to the lighting conditions to ensure that defects on the textile surface can be accurately detected under different lighting conditions.

[0031] In addition, the textile defect detection device also needs to have a certain anti-interference ability. In the textile production environment, there may be various interference factors, such as machine vibration, electromagnetic interference, etc. These interference factors may affect the acquisition quality of the textile CMOS surface image, and then affect the accuracy of defect detection. In order to cope with this situation, anti-shake technology and electromagnetic shielding technology can be used when collecting textile CMOS surface images. In the texture description mining branch and the defect detection mapping branch, the collected image can be pre-processed to reduce the impact of interference. For example, in the texture description mining branch, the grayscale symbiosis processing module can filter the image to remove noise points caused by machine vibration and other reasons, and then extract texture features. In the defect detection mapping branch, the result after the space vector transformation can also be subjected to similar filtering processing to ensure the accuracy of the final defect detection mapping vector, thereby improving the reliability of the textile defect classification and discrimination information.

[0032] The various parts of the textile defect detection device cooperate with each other and are continuously optimized and adjusted to adapt to the characteristics of textiles, production environment and other requirements, so as to achieve accurate and efficient detection of textile defects. Through the fine processing of texture description mining branches, defect detection mapping branches and the reasonable optimization of multi-classification support vector machine algorithm variables, the device can effectively improve the quality control level of textiles and play an important role in the production and quality inspection links of the textile industry.

[0033] In the long-term textile production process, the types and production processes of textiles may continue to innovate and change. For example, new functional textiles may appear with special textures or coatings on their surfaces, which poses new challenges to textile defect detection devices. For this case, the grayscale symbiosis processing module and the spectrum change recognition module in the texture description mining branch need to be upgraded and optimized. It may be necessary to redefine the way texture features are extracted and the key areas of spectrum analysis. For example, for textiles with waterproof coatings, the presence of the coating may change the optical properties of the textile surface. In the grayscale symbiosis processing module, the effect of the coating on the grayscale distribution needs to be considered, and new grayscale division standards may need to be added to accurately describe this special texture. The spectrum change recognition module may need to pay attention to the special performance of the interface between the coating and the textile substrate in the spectrum and adjust the analysis weights of different frequency bands.

[0034] In terms of defect detection mapping branches, the spatial vector transformation process also needs to be adjusted for new textiles. For example, for textiles with antibacterial functions, the antibacterial agents added may cause subtle changes in the color or texture of the textiles. In the spatial vector transformation, it is necessary to increase the consideration of these features related to the antibacterial function. At the same time, in order to ensure that the multi-classification support vector machine can adapt to the defect classification needs of new textiles, it is necessary to retrain the multi-classification support vector machine and adjust the algorithm variables. For example, for new defect types or situations that are different from traditional defect types, the position of the hyperplane is re-determined or the parameters of the kernel function are adjusted. Through these continuous improvements and optimizations, the textile defect detection device can always maintain the ability to detect defects of different types of textiles and adapt to the development needs of the textile industry.

[0035] In summary, the textile defect detection device, through a complex and orderly processing flow, from the acquisition of textile CMOS surface images to the final defect classification and algorithm optimization, fully considers the various characteristics of textiles, production environment factors and changes in industry development, and can provide a reliable and effective solution for textile quality inspection.

[0036] In a preferred embodiment, the multi-classification support vector machine includes w stacked first feature pyramid layers, each of the first feature pyramid layers includes at least two of the texture description mining branches stacked in the p texture description mining branches, and w is a positive integer not less than 2; the step of inputting the textile CMOS surface image into the p texture description mining branches, and sequentially performing texture recognition through each of the p texture description mining branches to obtain the surface texture description vector generated by the p texture description mining branches includes: inputting the textile CMOS surface image into the first first feature pyramid layer, and sequentially performing texture recognition through each of the texture description mining branches in the first first feature pyramid layer to obtain the pyramid vector of the first first feature pyramid layer; inputting the pyramid vector of the uth first feature pyramid layer into the u+1th first feature pyramid layer, and sequentially performing texture recognition through each of the texture description mining branches in the u+1th first feature pyramid layer to obtain the pyramid vector of the u+1th first feature pyramid layer, and u is a positive integer and u+1 is not greater than w.

[0037] Further, the multi-classification support vector machine includes w stacked second feature pyramid layers, each of the second feature pyramid layers includes at least three of the defect detection mapping branches stacked in the q defect detection mapping branches; the inputting the surface texture description vector into the q defect detection mapping branches, and sequentially performing mapping processing through each of the q defect detection mapping branches to obtain the defect detection mapping vector generated by the q defect detection mapping branches, includes: inputting the pyramid vector of the wth first feature pyramid layer into the first second feature pyramid layer, and sequentially performing mapping processing through each of the defect detection mapping branches in the first second feature pyramid layer to obtain the pyramid vector of the first second feature pyramid layer; inputting the pyramid vector of the wth first feature pyramid layer and the pyramid vector of the vth second feature pyramid layer into the v+1th second feature pyramid layer, and sequentially performing mapping processing through each of the defect detection mapping branches in the v+1th second feature pyramid layer to obtain the pyramid vector of the v+1th second feature pyramid layer, where v is a positive integer and v+1 is not greater than w.

[0038] In the textile defect detection device, the structure of the multi-classification support vector machine has a unique design, which includes w stacked first feature pyramid layers. w is a positive integer not less than 2, and this setting provides a basic architecture for the hierarchical processing of the entire multi-classification support vector machine. Each first feature pyramid layer includes at least two texture description mining branches stacked in p texture description mining branches.

[0039] When processing a textile CMOS surface image, the textile CMOS surface image is first input into the first first feature pyramid layer. Taking a specific textile detection situation as an example, if p is 5, each texture description mining branch in this first feature pyramid layer may have a specific processing capability. For example, each texture description mining branch in the first first feature pyramid layer has a certain division for the processing area of ​​the textile image, such as dividing the image into different sub-areas for texture recognition according to the horizontal or vertical direction. After performing texture recognition in turn through each texture description mining branch in this first feature pyramid layer, the pyramid vector of the first first feature pyramid layer can be obtained. This pyramid vector integrates the processing results of each texture description mining branch of this layer, and it contains description information of the texture features of the textile surface from different angles and scales.

[0040] Then, for the case where the positive integer u and u+1 is not greater than w, the pyramid vector of the u-th first feature pyramid layer is input into the u+1-th first feature pyramid layer. For example, when u=1, the pyramid vector obtained from the first first feature pyramid layer is input into the second first feature pyramid layer. In the second first feature pyramid layer, at least two texture description mining branches are also included, and these branches may differ from the branches in the first first feature pyramid layer in processing capabilities and emphasis. For example, the texture description mining branch in the first first feature pyramid layer focuses more on the macroscopic feature extraction of textile texture, such as the overall texture direction and grayscale changes at a larger scale, while the texture description mining branch in the second first feature pyramid layer further focuses on microscopic texture details on the basis of the first first feature pyramid layer, such as analyzing texture features such as grayscale co-occurrence matrix in a smaller pixel neighborhood (such as a 3×3 pixel neighborhood versus a 5×5 pixel neighborhood that may be used in the first first feature pyramid layer). Texture recognition is performed in sequence through each texture description mining branch in the u+1-th first feature pyramid layer to obtain the pyramid vector of the u+1-th first feature pyramid layer. In this way, through the progressive processing of multiple first feature pyramid layers, the texture features of the textile CMOS surface image can be continuously explored in depth, and the description of the texture can be gradually refined from macro to micro.

[0041] Further, the multi-classification support vector machine also includes stacked w second feature pyramid layers, each second feature pyramid layer includes at least three defect detection mapping branches stacked in q defect detection mapping branches. After obtaining the pyramid vector of the w-th first feature pyramid layer, it is input into the first second feature pyramid layer. For example, if q is 6, in the first second feature pyramid layer, these defect detection mapping branches begin to map the pyramid vectors transferred from the first feature pyramid layer. For example, in this second feature pyramid layer, the defect detection mapping branch reorganizes and maps the texture features in the pyramid vectors and converts them into feature representations that are more directly related to defect detection. For example, some components of the texture features related to the possibility of defects may be weighted according to some pre-set standards. If a certain texture feature component has a high correlation with a certain defect (such as a hole) in previous detections, it may be given a higher weight, such as a weight value of 0.8, while the weight of the component with a lower correlation may be 0.2. After each defect detection mapping branch in the first second feature pyramid layer is sequentially mapped, the pyramid vector of the first second feature pyramid layer is obtained.

[0042] Next, for a positive integer v and v+1 not greater than w, the pyramid vector of the wth first feature pyramid layer and the pyramid vector of the vth second feature pyramid layer are input into the v+1th second feature pyramid layer. For example, when v=1, the pyramid vector of the wth first feature pyramid layer and the pyramid vector of the first second feature pyramid layer are input into the second second feature pyramid layer. In the second second feature pyramid layer, the processing method of its defect detection mapping branch is different. Compared with the first second feature pyramid layer, the information from the first feature pyramid layer and the previous second feature pyramid layer may be further integrated to perform more complex mapping processing. For example, the first second feature pyramid layer may only preliminarily map the texture features to a defect-related feature space of a lower dimension, while the second second feature pyramid layer may further adjust the dimension and structure of this feature space and process the input vector according to the new mapping rule. The pyramid vector of the v+1th second feature pyramid layer is obtained by sequentially performing mapping processing on each defect detection mapping branch in the v+1th second feature pyramid layer.

[0043] There is a clear distinction between the first feature pyramid layer and the second feature pyramid layer. The first feature pyramid layer focuses on texture description mining, starting from the textile CMOS surface image, and gradually digging into texture features. There is a progressive texture feature refinement mining relationship between its layers. For example, from coarser texture direction recognition to finer grayscale co-occurrence matrix micro-feature extraction. The second feature pyramid layer focuses on defect detection mapping, reorganizing and mapping the texture features mined from the first feature pyramid layer, converting them into feature representations directly related to defect detection, and continuously optimizing the defect detection mapping results by integrating information from different sources (the first feature pyramid layer and the previous second feature pyramid layer) between the layers.

[0044] Through such a multi-classification support vector machine structure, the defect detection of the CMOS surface image of the textile can be performed more systematically and comprehensively. During the entire processing process, the first feature pyramid layer and the second feature pyramid layer at different levels cooperate with each other to analyze the texture and defects of the textile from multiple angles and levels. For example, for different types of textiles, such as cotton and silk, due to their large texture differences, this hierarchical structure can adaptively adjust the processing methods for texture and defects. For textiles such as cotton with relatively rough texture and relatively weak regularity, the first feature pyramid layer can start to focus on larger-scale texture changes at a lower level, while for textiles such as silk with fine texture and strong regularity, the first feature pyramid layer can further explore micro-texture features at a higher level. Similarly, the second feature pyramid layer can also perform defect detection mapping more accurately according to the characteristics of different textiles and the processing results of the first feature pyramid layer. This structure can effectively improve the accuracy and efficiency of textile defect detection and adapt to the detection needs of different textiles.

[0045] This design effectively improves the performance of textile defect detection through the unique first feature pyramid layer and second feature pyramid layer structure in the multi-classification support vector machine. The first feature pyramid layer deeply mines the texture features of textiles from different levels, providing rich basic information for defect detection. The second feature pyramid layer converts texture features into feature representations related to defect detection, and optimizes the detection results through information integration between multiple layers. This hierarchical structure can adapt to the texture differences of different types of textiles, improve the accuracy of detection, and also improve the detection efficiency, providing a reliable technical guarantee for textile quality control.

[0046] In the following design idea, each of the first feature pyramid layers includes a stacked first texture description mining branch and a second texture description mining branch, the spectrum change recognition module of the first texture description mining branch is an inter-class feature enhancement module, and the spectrum change recognition module of the second texture description mining branch is a deep convolution module; the pyramid vector of the u-th first feature pyramid layer is input into the u+1-th first feature pyramid layer, and texture recognition is performed in sequence through each of the texture description mining branches in the u+1-th first feature pyramid layer to obtain the pyramid vector of the u+1-th first feature pyramid layer, including: inputting the pyramid vector of the u-th first feature pyramid layer into the first texture description mining branch of the u+1-th first feature pyramid layer; mining texture elements through the grayscale symbiosis processing module and the inter-class feature enhancement module of the first texture description mining branch in sequence; The pyramid vector of the pyramid layer and the intermediate texture element vector of the grayscale symbiosis processing module of the first texture description mining branch are combined with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch to obtain the intermediate layer texture vector of the first texture description mining branch; the intermediate layer texture vector of the first texture description mining branch is input into the second texture description mining branch of the u+1th first feature pyramid layer; texture enhancement is performed in sequence through the grayscale symbiosis processing module and the deep convolution module of the second texture description mining branch; the intermediate layer texture vector of the first texture description mining branch and the texture enhancement vector of the grayscale symbiosis processing module of the second texture description mining branch are weighted by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch to obtain the pyramid vector of the u+1th first feature pyramid layer.

[0047] Based on this embodiment, the structural design of each first feature pyramid layer is more detailed, including a stacked first texture description mining branch and a second texture description mining branch.

[0048] For the first texture description mining branch, its spectrum change recognition module is an inter-class feature enhancement module. When the pyramid vector of the u-th first feature pyramid layer is input into the first texture description mining branch of the u+1-th first feature pyramid layer, it will first be processed by the grayscale symbiosis processing module. For example, in the grayscale symbiosis processing module, the symbiosis relationship of pixels of different grayscale levels may be analyzed in units of 8×8 pixel blocks for a specific area in the textile image, so as to preliminarily mine some texture elements.

[0049] Then enter the inter-class feature enhancement module, the function of this module is to enhance the feature distinction between different categories. For example, in the texture of textiles, normal textures and textures with defects (such as holes, stains and other types of defects) will have different performances in the spectrum. For example, the energy distribution of normal textile textures in a certain frequency band of the spectrum is relatively stable, while the energy of textile textures with holes in this frequency band may have a significant decrease or fluctuation. The inter-class feature enhancement module will enhance this difference. It may generate an inter-class attention vector by comparing and analyzing the features of different categories of textures on the spectrum. This inter-class attention vector can guide the focus on those features that help distinguish different categories (normal and defective categories).

[0050] Then, the pyramid vector of the u-th first feature pyramid layer and the intermediate texture element vector of the grayscale co-occurrence processing module of the first texture description mining branch are combined with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch to obtain the intermediate layer texture vector of the first texture description mining branch. The feature transfer indication here plays a role in coordinating the fusion of different vector information, ensuring that each part of the information can be combined in a predetermined manner, thereby accurately constructing the intermediate layer texture vector.

[0051] After that, the middle-layer texture vector of the first texture description mining branch is input into the second texture description mining branch of the u+1th first feature pyramid layer. In the second texture description mining branch, its spectrum change recognition module is a deep convolution module. It also first passes through the grayscale co-occurrence processing module. This module may adjust the processing method, for example, from the previous analysis of 8×8 pixel blocks to re-analyzing the texture enhancement vector with 6×6 pixel blocks, in order to further mine texture features from different scales.

[0052] The deep convolution module plays an important role in this process. Deep convolution can perform deep feature extraction and enhancement of texture features. For example, the deep convolution module may contain multiple convolution layers, such as 3 convolution layers, and the convolution kernel size of each convolution layer may be different, such as the convolution kernel size of the first layer is 3×3, the second layer is 5×5, and the third layer is 3×3. Through the convolution operation of these convolution kernels of different sizes, texture features can be extracted from different receptive fields and the representation of texture features can be gradually enhanced. The texture vector of the intermediate layer of the first texture description mining branch and the texture enhancement vector of the grayscale symbiosis processing module of the second texture description mining branch are weighted by the convolution vector of the deep convolution module of the second texture description mining branch through the feature transfer indication to obtain the pyramid vector of the u+1th first feature pyramid layer. This weighted operation can integrate the information of each part, so that the final pyramid vector can more comprehensively reflect the texture characteristics of the textile.

[0053] Throughout the whole process, the inter-class feature enhancement module of the first texture description mining branch and the deep convolution module of the second texture description mining branch cooperate with each other. The inter-class feature enhancement module screens and enhances texture features from the perspective of category distinction, focusing on those features that can distinguish different categories (normal and defective), providing targeted information for subsequent processing. The deep convolution module further enhances texture features from the perspective of deep feature extraction, and mines deep-level features of textures from different scales and angles through multi-layer convolution operations. The two work together through the transmission of intermediate layer texture vectors and weighted operations, so that each first feature pyramid layer can more effectively mine the texture features of textiles, and with the progressive layer of the first feature pyramid layer, the ability to describe the texture features of textiles can be continuously improved, thus laying a solid foundation for accurate textile defect detection.

[0054] It can be seen that by setting the first texture description mining branch including the inter-class feature enhancement module and the second texture description mining branch including the deep convolution module in the first feature pyramid layer, the mining ability of textile texture features is effectively improved. The inter-class feature enhancement module helps to highlight the differences in texture features between different categories (normal and defective), while the deep convolution module enhances texture features from the perspective of deep feature extraction. The two work together and obtain more comprehensive and accurate pyramid vectors through a series of vector operations, which improves the accuracy and reliability of textile defect detection and provides better technical support for textile quality inspection.

[0055] On the basis of the above embodiment, the pyramid vector of the u-th first feature pyramid layer and the intermediate texture element vector of the grayscale symbiosis processing module of the first texture description mining branch are combined with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch to obtain the intermediate layer texture vector of the first texture description mining branch, further including: determining a first feature confidence weighted result of the pyramid vector of the u-th first feature pyramid layer and a first confidence coefficient; and determining a second feature confidence weighted result of the grayscale symbiosis vector of the grayscale symbiosis processing module of the first texture description mining branch and a second confidence coefficient; combining the first feature confidence weighted result and the second feature confidence weighted result with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch.

[0056] Next, the intermediate layer texture vector of the first texture description mining branch and the texture enhancement vector of the grayscale symbiosis processing module of the second texture description mining branch are weighted by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch to obtain the pyramid vector of the u+1th first feature pyramid layer, further including: determining a third feature confidence weighted result of the intermediate layer texture vector of the first texture description mining branch and a third confidence coefficient; and determining a fourth feature confidence weighted result of the grayscale symbiosis vector of the grayscale symbiosis processing module of the second texture description mining branch and a fourth confidence coefficient; and weighting the third feature confidence weighted result and the fourth feature confidence weighted result by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch.

[0057] In addition, the method also includes: adjusting at least one of the first confidence coefficient, the second confidence coefficient, the third confidence coefficient and the fourth confidence coefficient based on the difference between the defect classification authentication information of the textile CMOS surface image and the defect classification discrimination information.

[0058] The technical solution involves a series of complex operations to construct texture vectors, which are crucial for accurate detection of textile defects.

[0059] When constructing the intermediate layer texture vector of the first texture description mining branch, it is a key step to determine the first feature confidence weighted result of the pyramid vector of the u-th first feature pyramid layer and the first confidence coefficient. Taking the actual textile detection as an example, the pyramid vector of the u-th first feature pyramid layer contains multiple components, which reflect different texture features extracted from the textile image. For example, a component of the pyramid vector of the u-th first feature pyramid layer represents the directional feature of the textile texture, and its value is 10. The first confidence coefficient is 0.6, and the determination of this coefficient may be based on a large amount of experimental data or prior knowledge of textile texture features. When calculating the first feature confidence weighted result, according to the multiplication rule, the first feature confidence weighted result of this component is 10×0.6=6. This result means that when constructing the intermediate layer texture vector, the weight of this component representing the texture directional feature is adjusted according to the first confidence coefficient. Different components may correspond to different texture features, such as texture roughness, periodicity, etc., and each component will be multiplied by the first confidence coefficient in the same way to obtain its own first feature confidence weighted result. This process is a weighted adjustment of the pyramid vector as a whole, with the aim of highlighting or suppressing the influence of certain texture features based on the first confidence coefficient.

[0060] At the same time, for the grayscale symbiosis vector of the grayscale symbiosis processing module of the first texture description mining branch, the second feature confidence weighted result with the second confidence coefficient is also determined. The grayscale symbiosis vector is obtained by analyzing the grayscale symbiosis matrix of the textile image, which contains rich information about the grayscale symbiosis relationship of pixels. For example, a component of the grayscale symbiosis vector reflects the frequency of two specific grayscale pixels appearing at the same time in a specific direction and distance, and its value is 8. The second confidence coefficient is 0.7, which is also determined based on the understanding of the importance of textile texture features and grayscale symbiosis relationships. The second feature confidence weighted result of calculating this component is 8×0.7=5.6. Similar to the first feature confidence weighted result, each component of the entire grayscale symbiosis vector will be multiplied by the second confidence coefficient to obtain its own weighted result.

[0061] Then, the first feature confidence weighted result and the second feature confidence weighted result are combined with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch. The inter-class attention vector is an important output of the inter-class feature enhancement module, which is obtained by in-depth analysis of the differences in the spectrum of textures of different categories (normal and defective). For example, in textiles, normal textures and textures with holes and defects have significantly different energy distribution characteristics in certain frequency bands of the spectrum. The inter-class feature enhancement module determines these spectral features that can effectively distinguish different categories by analyzing the spectrum of a large number of normal and defective textile images, and then constructs the inter-class attention vector. The feature transfer indication plays a key role in coordination and guidance in this process. It specifies the combination method between the first feature confidence weighted result, the second feature confidence weighted result and the inter-class attention vector. For example, the feature transfer indication may specify that the components of these vectors are added in a certain order or combined according to specific weights. In this way, the intermediate layer texture vector of the first texture description mining branch can be constructed more accurately, so that the texture information contained therein can reflect the characteristics of the textile more accurately and specifically.

[0062] Next, when constructing the pyramid vector of the u+1th first feature pyramid layer, the third feature confidence weighted result of the intermediate layer texture vector of the first texture description mining branch and the third confidence coefficient is determined. The intermediate layer texture vector is obtained through the previous complex operations, and it contains the adjusted and optimized textile texture feature information. For example, a component of the intermediate layer texture vector represents a certain comprehensive texture feature after processing in the previous steps, and its value is 12. The third confidence coefficient is 0.8, and the setting of this coefficient is also based on the consideration of the textile texture features and the entire detection process. The third feature confidence weighted result of the component is calculated to be 12×0.8=9.6. This weighted result reflects the adjustment of the intermediate layer texture vector according to the third confidence coefficient.

[0063] And determine the fourth feature confidence weighted result of the grayscale symbiosis vector of the grayscale symbiosis processing module of the second texture description mining branch and the fourth confidence coefficient. The grayscale symbiosis processing module of the second texture description mining branch will also generate a grayscale symbiosis vector when processing texture features. This vector also contains information about the grayscale symbiosis relationship of the pixels in the textile image. For example, the value of a certain component is 9, which may reflect the grayscale symbiosis relationship at a different scale or direction from the first texture description mining branch. The fourth confidence coefficient is 0.75, and the fourth feature confidence weighted result of the component is 9×0.75=6.75.

[0064] The third feature confidence weighted result and the fourth feature confidence weighted result are then weighted with the convolution vector of the deep convolution module of the second texture description mining branch through the feature transfer indication. The convolution vector of the deep convolution module of the second texture description mining branch is obtained through the deep convolution operation, which can extract texture features from different receptive fields, thereby constructing a convolution vector containing rich texture depth information. For example, a component of the convolution vector is 11, which may represent information related to the texture depth feature of the textile extracted under a specific convolution layer. The weighted result is weighted and calculated with it through the coordination of the feature transfer indication. The feature transfer indication here ensures that each vector is combined in a predetermined manner, so that the pyramid vector of the first feature pyramid layer of the u+1th layer can fully and accurately reflect the texture features of the textile. This process involves complex operations and combinations of multiple vectors, and the components of each vector are weighted and combined according to specific rules, so as to integrate the texture feature information from different processing modules.

[0065] In addition, the whole method also includes adjusting at least one of the first confidence coefficient, the second confidence coefficient, the third confidence coefficient and the fourth confidence coefficient based on the difference between the defect classification authentication information and the defect classification discrimination information of the textile CMOS surface image. In the actual textile defect detection process, the defect classification authentication information is accurate information on whether the textile has defects and the type of defects obtained by reliable methods (such as a large number of accurate samples manually labeled). The defect classification discrimination information is the discrimination result obtained by the current detection algorithm. When there is a difference between these two types of information, for example, when the defect classification authentication information indicates that the textile has a certain defect (such as stains), but the defect classification discrimination information is misjudged as normal, this indicates that the current weighting coefficient may be unreasonable.

[0066] If it is found through detailed analysis that the setting of the first confidence coefficient leads to inaccurate results of the first feature confidence weighting, thus affecting the construction of the entire texture vector and defect judgment, then the first confidence coefficient needs to be adjusted. For example, the original first confidence coefficient is 0.6, and it may be adjusted to 0.7 or other appropriate values ​​after analysis. This adjustment process is not arbitrary, but is based on a deep understanding of the entire detection process and the texture characteristics of textiles. It may be necessary to re-analyze the role of the texture features related to the first confidence coefficient in the textile image in defect detection and re-evaluate the rationality of its weight. Similarly, if the problem is caused by the second confidence coefficient, the third confidence coefficient or the fourth confidence coefficient, it will also be adjusted in a similar way. Through such adjustments, the entire texture vector construction process can be continuously optimized and the accuracy of textile defect detection can be improved. After each adjustment of the confidence coefficient, the entire detection process will be repeated to verify the effect of the adjustment until the difference between the defect classification authentication information and the defect classification discrimination information is reduced to an acceptable range.

[0067] Therefore, by performing confidence weighting operations on each vector in the process of constructing the texture vector and adjusting the confidence coefficient according to the difference between the defect classification authentication information and the discrimination information, the accuracy of the construction of the textile texture feature vector is significantly improved. This improvement in accuracy enables each texture vector to more accurately reflect the true characteristics of the textile, thereby fundamentally improving the accuracy and reliability of defect detection. This helps to reduce the occurrence of misjudgment in textile quality inspection and ensure the quality inspection level of textiles, which is of great significance to quality control in the textile industry.

[0068] On the basis of step 202 to step 206, the method further includes: performing feature annotation on the defect detection mapping vectors generated by the q defect detection mapping branches to obtain defect detection mapping annotation vectors.

[0069] In the textile defect detection device, based on the operation flow of the previous steps 202-206, this embodiment further includes an operation of feature labeling the defect detection mapping vectors generated by the q defect detection mapping branches to obtain a defect detection mapping label vector.

[0070] First, review the previous steps. In step 202, the textile CMOS surface image is obtained and processed through p texture description mining branches to obtain a surface texture description vector. This process involves the operation of the grayscale symbiosis processing module and the spectrum change recognition module in each texture description mining branch. Multiple texture description mining branches are processed layer by layer to finally obtain surface texture description vectors, which contain rich information about the surface texture of the textile. In step 204, the surface texture description vector is input into q defect detection mapping branches, and the defect detection mapping vector is obtained after the grayscale symbiosis processing module and the spectrum change recognition module in each defect detection mapping branch perform space vector transformation and other operations.

[0071] Now we need to feature label the defect detection mapping vector. For the defect detection mapping vectors obtained by the q defect detection mapping branches, each vector represents a feature representation of the textile image in terms of defect detection. For example, the value of q may be 5, and the five defect detection mapping branches may perform defect detection mapping on the textile image from different angles or based on different algorithms. The defect detection mapping vector obtained by the first defect detection mapping branch may reflect the characteristics of the textile surface texture related to stain-type defects in some dimensions, the vector of the second defect detection mapping branch may focus more on the characteristics related to hole-type defects, and so on.

[0072] When performing feature annotation, it is necessary to clarify the specific meaning of each vector dimension or component. Taking the defect detection mapping vector obtained by one of the defect detection mapping branches as an example, this vector may have multiple components, for example, the vector has 10 components. The value of the first component is 8, which may be annotated as being related to the roughness of a specific texture feature on the surface of the textile after analysis, and this roughness feature is associated with a certain type of defect (such as uneven yarn on the surface of the textile); the value of the second component is 3, which may be annotated as being related to the directional feature of the texture, and this directional feature has a certain meaning in distinguishing different types of defects (such as distinguishing between horizontal cracks and longitudinal cracks). Such detailed annotation is performed on the defect detection mapping vector of each defect detection mapping branch to obtain a defect detection mapping annotation vector.

[0073] This annotation process is not random, but based on a deep understanding of the textile texture features, defect types, and previous processing flows. For example, in the previous texture description mining branch processing, if a certain texture feature is found to always show a specific change when a specific defect appears, then the component related to this texture feature in the defect detection mapping vector will be annotated as a feature related to the defect. At the same time, for different defect detection mapping branches, due to their different focuses in the processing process, the basis and content of the annotation will also be different.

[0074] For those defect detection mapping branches that focus on detecting stains on the surface of textiles, some components in their defect detection mapping vectors may be labeled as features related to stain color, stain distribution density, etc. For example, a component value of 5 may be labeled as related to the depth of the stain color after analysis. This is because it was found in previous processing that the value of this component is always larger in textile images with dark stains, and smaller in images with normal or light stains. For defect detection mapping branches that focus on detecting holes, some components in their vectors may be labeled as features related to texture changes around the holes and the size of the holes. For example, a component value of 10 may be labeled as a feature proportional to the size of the hole. The larger the hole, the larger the value of this component.

[0075] Through such a comprehensive and detailed feature annotation process, the defect detection mapping annotation vector obtained has higher information value. It not only contains the original numerical information of the defect detection mapping vector, but also clarifies the specific feature meaning represented by each numerical value. This is of great significance for the subsequent classification and judgment of textile defects and the optimization of the entire detection system.

[0076] When classifying and distinguishing textile defects based on the defect detection mapping annotation vector, since each component has a clear label, the type of defect in the textile can be judged more accurately. For example, if the value of the component related to the color depth of the stain in the defect detection mapping annotation vector exceeds a certain threshold (such as 6), and the value of the component related to the stain distribution density also reaches a certain level (such as 4), then it can be more confidently determined that there are stain-type defects on the textile surface. Similarly, for hole-type defects, if the value of the component proportional to the size of the hole is large (such as above 8), and the component related to the texture change around the hole also shows a specific pattern, it can be determined that the textile has a hole-type defect.

[0077] When optimizing the entire textile defect detection system, the defect detection mapping annotation vector also provides an important basis. For example, if it is found that a component labeled as related to a specific defect is always inaccurate in the actual detection results (such as often misjudging a textile without the defect as having the defect), then the defect detection mapping branch or the previous texture description mining branch that generates this component can be adjusted in a targeted manner. This may be to adjust the parameters of the grayscale symbiosis processing module in the branch, or to re-examine the algorithm logic of the spectrum change recognition module.

[0078] In this way, the defect detection mapping annotation vector is obtained by feature annotation of the defect detection mapping vector, which improves the interpretability of the defect detection results. The relationship between each component of the vector and the texture and defect characteristics of the textile is clarified, which helps to classify and distinguish defects more accurately. At the same time, it provides a detailed basis for the optimization of the detection system, and can improve the inaccurate detection part in a targeted manner, thereby improving the accuracy of textile defect detection and the stability of the system.

[0079] In some possible examples, each of the second feature pyramid layers includes a stacked first defect detection mapping branch, a second defect detection mapping branch, and a third defect detection mapping branch, the spectrum change recognition module of the first defect detection mapping branch is a first inter-class feature enhancement module, the spectrum change recognition module of the second defect detection mapping branch is a second inter-class feature enhancement module, and the spectrum change recognition module of the third defect detection mapping branch is a deep convolution module; then the pyramid vector of the wth first feature pyramid layer and the pyramid vector of the vth second feature pyramid layer are input into the v+1th second feature pyramid layer, and each of the defect detection mapping branches in the v+1th second feature pyramid layer is used to identify the defect detection mapping branch. The method comprises: inputting the pyramid vector of the vth second feature pyramid layer into the first defect detection mapping branch of the vth second feature pyramid layer; sequentially performing linear mapping through the grayscale symbiosis processing module and the first inter-class feature enhancement module of the first defect detection mapping branch; summing the pyramid vector of the vth second feature pyramid layer and the grayscale symbiosis vector of the grayscale symbiosis processing module of the first defect detection mapping branch through the feature transfer indication and the inter-class attention vector of the first inter-class feature enhancement module of the first defect detection mapping branch, Obtain a detection mapping decision vector of the first defect detection mapping branch; input the pyramid vector of the wth first feature pyramid layer and the detection mapping decision vector of the first defect detection mapping branch into the second defect detection mapping branch of the v+1th second feature pyramid layer; sequentially process through the grayscale symbiosis processing module and the second inter-class feature enhancement module of the second defect detection mapping branch; perform the feature transfer indication and the inter-class attention vector of the second inter-class feature enhancement module of the second defect detection mapping branch on the detection mapping decision vector of the first defect detection mapping branch. Sum the detection mapping decision vector of the second defect detection mapping branch to obtain the detection mapping decision vector of the second defect detection mapping branch; input the detection mapping decision vector of the second defect detection mapping branch into the third defect detection mapping branch of the v+1th second feature pyramid layer; process them in sequence through the grayscale symbiosis processing module and the deep convolution module of the third defect detection mapping branch; sum the detection mapping decision vector of the second defect detection mapping branch and the grayscale symbiosis vector of the grayscale symbiosis processing module of the third defect detection mapping branch through the feature transfer indication and the convolution vector of the deep convolution module of the third defect detection mapping branch to obtain the pyramid vector of the v+1th second feature pyramid layer.

[0080] In this embodiment of the textile defect detection device, the structure of each second feature pyramid layer includes a stacked first defect detection mapping branch, a second defect detection mapping branch and a third defect detection mapping branch. This structural design lays the foundation for the entire defect detection mapping process.

[0081] First, when the pyramid vector of the vth second feature pyramid layer is input into the first defect detection mapping branch of the v+1th second feature pyramid layer, a series of complex mapping processes begins. In the first defect detection mapping branch, linear mapping is performed in sequence through the grayscale symbiosis processing module and the first inter-class feature enhancement module. For example, the grayscale symbiosis processing module of the first defect detection mapping branch may analyze the input pyramid vector based on a specific pixel neighborhood, such as taking an 8×8 pixel neighborhood as a unit, and analyze the symbiosis relationship of pixels of different gray levels therein, thereby obtaining a grayscale symbiosis vector. This vector contains information about the local texture features of the textile image.

[0082] Then, the first inter-class feature enhancement module comes into play. The inter-class attention vector of the first inter-class feature enhancement module of the first defect detection mapping branch is obtained by analyzing the features of different categories (such as normal textiles and textiles with different types of defects). For example, in textiles, normal textures and stained textures have obvious differences in certain frequency bands of the spectrum. The first inter-class feature enhancement module can capture this difference and then construct an inter-class attention vector. Then, the pyramid vector of the v-th second feature pyramid layer and the grayscale symbiosis vector of the grayscale symbiosis processing module of the first defect detection mapping branch are summed with the inter-class attention vector of the first inter-class feature enhancement module of the first defect detection mapping branch through the feature transfer indication to obtain the detection mapping decision vector of the first defect detection mapping branch. This summation operation is performed in accordance with the method specified by the feature transfer indication, ensuring the accurate fusion of each vector information, so that the detection mapping decision vector can comprehensively consider information from different aspects, thereby providing a more valuable decision basis for subsequent processing.

[0083] Afterwards, the pyramid vector of the w-th first feature pyramid layer and the detection mapping decision vector of the first defect detection mapping branch are input into the second defect detection mapping branch of the v+1-th second feature pyramid layer. In the second defect detection mapping branch, the grayscale symbiosis processing module and the second inter-class feature enhancement module are also sequentially processed. The grayscale symbiosis processing module of the second defect detection mapping branch may adopt a different processing method from the first defect detection mapping branch, for example, analyzing a 6×6 pixel neighborhood to re-acquire grayscale symbiosis information about the textile texture. The second inter-class feature enhancement module is similar to the first inter-class feature enhancement module, but may focus on different types of inter-class feature differences. For example, the first inter-class feature enhancement module may focus more on distinguishing normal textures from stain-type defect textures, while the second inter-class feature enhancement module may focus more on the differences in the spectrum between normal textures and hole-type defect textures. Then, the detection mapping decision vector of the first defect detection mapping branch and the grayscale symbiosis vector of the grayscale symbiosis processing module of the second defect detection mapping branch are summed with the inter-class attention vector of the second inter-class feature enhancement module of the second defect detection mapping branch through the feature transfer indication to obtain the detection mapping decision vector of the second defect detection mapping branch. This process further integrates information from different sources and conducts a deeper mining of the defect characteristics of textiles.

[0084] The detection mapping decision vector of the second defect detection mapping branch is then input into the third defect detection mapping branch of the v+1th second feature pyramid layer. In the third defect detection mapping branch, it is processed by the grayscale symbiosis processing module and the deep convolution module in turn. The grayscale symbiosis processing module of the third defect detection mapping branch analyzes the texture features of the textile from different angles again, such as focusing on larger-scale texture changes and analyzing with a 10×10 pixel neighborhood. The deep convolution module performs a deep convolution operation on the input detection mapping decision vector and extracts features through multiple convolution layers (for example, 3 convolution layers). The convolution kernel size of each convolution layer may be different, such as the convolution kernel of the first layer is 3×3, the second layer is 5×5, and the third layer is 3×3. In this way, texture features are extracted from different receptive fields. Finally, the detection mapping decision vector of the second defect detection mapping branch and the grayscale symbiosis vector of the grayscale symbiosis processing module of the third defect detection mapping branch are summed with the convolution vector of the depth convolution module of the third defect detection mapping branch through the feature transfer indication to obtain the pyramid vector of the v+1 second feature pyramid layer. This pyramid vector integrates the results of the previous processing steps and contains rich information about the characteristics of textile defects.

[0085] In the whole process, the first inter-class feature enhancement module of the first defect detection mapping branch, the second inter-class feature enhancement module of the second defect detection mapping branch, and the deep convolution module of the third defect detection mapping branch cooperate with each other. The first inter-class feature enhancement module processes the input vector from the perspective of specific inter-class feature differences, providing a preliminary decision basis for subsequent processing. On the basis of the first defect detection mapping branch, the second inter-class feature enhancement module further explores the feature differences between different classes and improves the decision basis. The deep convolution module processes the previous decision vector from the perspective of deep feature extraction, and enhances the representation ability of textile defect features through deep convolution operations. These three modules gradually integrate different information together through a series of vector summation operations, so that the pyramid vector of the v+1th second feature pyramid layer can fully and accurately reflect the defect characteristics of textiles.

[0086] In this way, by setting three defect detection mapping branches with different functional modules (first inter-class feature enhancement module, second inter-class feature enhancement module and deep convolution module) in the second feature pyramid layer, and through a specific vector processing process, the ability to mine and integrate textile defect features is effectively improved. The collaborative work between the various modules can capture textile defect information more comprehensively and accurately, thereby improving the accuracy and reliability of textile defect detection and providing more effective technical support for textile quality inspection.

[0087] Based on steps 202 to 206, the method further includes: setting the statistical value of the algorithm variables optimized by the multi-classification support vector machine in each cycle not to exceed a statistical threshold value on the basis that the number of loop debugging times of the multi-classification support vector machine is not greater than a first set number value; and canceling the setting of the statistical threshold value on the basis that the number of loop debugging times of the multi-classification support vector machine is not less than a second set number value, and the second set number value is greater than the first set number value.

[0088] In the textile defect detection device, based on the basic process constructed in the previous steps 202-206, this embodiment introduces a setting mechanism for the number of loop debugging times of the multi-classification support vector machine and the statistical value of the algorithm variables.

[0089] First, when the number of loop debugging of the multi-classification support vector machine is not greater than the first set number of times, the statistical value of the algorithm variable optimized by the multi-classification support vector machine in each cycle is set not to exceed the statistical threshold value. The multi-classification support vector machine plays a key role in the entire textile defect detection process, and the optimization of its performance is crucial for accurate defect detection. In the early loop debugging stage, for example, when the first set number of times is 10 loop debugging, the multi-classification support vector machine may still be in the initial optimization adjustment period. At this time, setting the algorithm variable statistical value not to exceed the statistical threshold value is an effective control strategy.

[0090] For example, at this stage, the algorithm variable statistics of the multi-classification support vector machine optimization may involve some values ​​related to the feature weight adjustment or the classification hyperplane adjustment. If the feature weight adjustment is taken as an example, there may be multiple weight values ​​corresponding to the features, and the sum of the changes of these weight values ​​in each round of optimization needs to not exceed the statistical threshold value. For example, there are 5 feature weights. Before the first round of optimization, they are 0.1, 0.2, 0.3, 0.15, and 0.25, respectively. After one round of optimization, they become 0.12, 0.21, 0.31, 0.16, and 0.23. The sum of the absolute values ​​of the changes of these weight values ​​(such as |0.12-0.1|+|0.21-0.2|+|0.31-0.3|+|0.16-0.15|+|0.23-0.25|) must not exceed the statistical threshold value. The setting of this statistical threshold value is based on the consideration of stability and convergence in the early loop debugging stage. By limiting the statistical value of the algorithm variables to not exceed this threshold value, it is possible to prevent excessive fluctuations in the algorithm variables during the early optimization process, thereby ensuring that the multi-classification support vector machine is gradually optimized within a relatively stable range.

[0091] At this stage, since the multi-classification support vector machine may not have fully learned the complex features and classification patterns of textile defects, excessive variable adjustment may cause the model to be unstable and may even deviate from the correct optimization direction. For example, if this statistical threshold value is not set, a feature weight may suddenly change from 0.1 to 0.5 in a certain cycle, which may destroy some of the previously established cognitions about the relationship between textile texture features and defects, causing the model to make more errors in subsequent detections.

[0092] However, when the number of loop debugging of the multi-classification support vector machine is not less than the second set number value, the situation changes. Here, the second set number value is greater than the first set number value, for example, the second set number value is 50 loop debugging. At this stage, the multi-classification support vector machine has undergone a certain number of loop debugging and has a deeper understanding of the characteristics and classification patterns of textile defects. At this time, the statistical threshold value is canceled. This is because at this stage, the multi-classification support vector machine has been relatively stable, and the model has a certain accuracy and reliability in textile defect detection.

[0093] After the statistical threshold is cancelled, the algorithm variables of the multi-classification support vector machine can have a larger adjustment space. For example, at this stage, if it is found that some feature weights need to be adjusted significantly to further improve the accuracy of the model, they can be adjusted without being restricted by the previous statistical threshold. For example, under the previous statistical threshold, the feature weight related to a specific texture feature of the textile could not be adjusted sufficiently, resulting in insufficient accuracy when detecting a certain special defect (such as a tiny stain defect). Now that the statistical threshold has been cancelled, this feature weight can be adjusted more significantly according to the actual situation, for example, from 0.2 to 0.35, so that the model can better adapt to the detection of this special defect. This adjustment can further optimize the performance of the multi-classification support vector machine and improve the accuracy of textile defect detection.

[0094] This phased strategy helps improve the optimization efficiency and accuracy of the multi-classification support vector machine throughout the textile defect detection process. In the early stage, the statistical values ​​of the algorithm variables are limited to not exceed the statistical threshold value, which ensures the stability and gradual convergence of the model; in the later stage, the statistical threshold value is cancelled, which provides the model with more adjustment space to further optimize the performance.

[0095] It can be seen that by setting the limits of the statistical values ​​of the algorithm variables in stages according to the number of loop debugging during the loop debugging process of the multi-classification support vector machine, the efficiency and accuracy of the multi-classification support vector machine optimization are improved. The early limit of the statistical threshold value ensures the stable convergence of the model and prevents excessive fluctuations; the later cancellation of the statistical threshold value provides a larger adjustment space for further optimization, which helps to improve the accuracy of textile defect detection and make the entire detection system more efficient and reliable.

[0096] The multi-classification support vector machine trained through steps 202 to 206 can be used for subsequent defect classification detection. Based on this, the method further includes: inputting the CMOS surface image to be detected of the target textile into the multi-classification support vector machine to obtain defect classification detection information corresponding to the CMOS surface image to be detected.

[0097] In the textile defect detection device, the multi-classification support vector machine trained based on the previous steps 202-206 is a key part of the entire defect classification detection system. After a series of complex operations, this multi-classification support vector machine has the ability to classify and detect defects on textile CMOS surface images.

[0098] When the CMOS surface image of the target textile is to be inspected, it is input into the multi-classification support vector machine. The multi-classification support vector machine has a complex structure and algorithm logic. For example, each support vector in the multi-classification support vector machine is trained by a large number of textile CMOS surface image samples (including samples with defects and without defects). These support vectors divide different areas in the feature space, and each area corresponds to a different defect type or normal state.

[0099] For the CMOS surface image of the target textile to be inspected, it is first converted into a vector form that can be recognized by the machine. This vector contains various feature information extracted from the image, which may be related feature representations obtained through the texture description mining branch and defect detection mapping branch in the previous steps. For example, the texture features in the image may be quantified into certain components in the vector, and the values ​​of these components reflect different characteristics of the texture, such as the roughness and directionality of the texture.

[0100] When the vector representing the image of the CMOS surface to be inspected is input into the multi-classification support vector machine, the multi-classification support vector machine starts to calculate the distance or similarity between this vector and each support vector. For example, there are 5 different categories (4 defect types and 1 normal type). For each support vector corresponding to each category, the multi-classification support vector machine will calculate the relationship between the vector to be inspected and it. If the multi-classification support vector machine adopts a distance-based discrimination method, it will calculate the distance between the vector to be inspected and the support vector of each category.

[0101] For example, for a support vector representing a stain defect, the calculated distance is 3, for a support vector representing a hole defect, the distance is 5, for a support vector representing a normal state, the distance is 2, and so on. Then, based on these distance relationships, the multi-classification support vector machine determines the defect classification detection information corresponding to the CMOS surface image to be detected according to the pre-set discrimination rules. For example, it may be set that the closest distance to a certain support vector is determined to be that category. Since the distance to the support vector of the normal state is 2, which is the shortest distance, the target textile corresponding to the CMOS surface image to be detected is determined to be in a normal state. If the distance to the support vector of a certain defect type is the shortest, it is determined that the target textile has that type of defect.

[0102] In this process, the accuracy of the multi-classification support vector machine depends on the previous training process and its internal algorithm structure. Previously in steps 202-206, if the texture description mining branch can accurately mine the texture features of the textile, and the defect detection mapping branch can effectively map these texture features into features related to the defect, then it is more likely to obtain accurate results when the CMOS surface image to be detected is classified and detected later. Moreover, the number and distribution of support vectors within the multi-classification support vector machine will also affect the detection results. If the number of support vectors is too small, it may not be possible to accurately divide the boundaries between different categories, resulting in misjudgment. For example, if only a small number of support vectors are used to represent stain-type defects, then some stain-type defects with special texture features may not be accurately identified.

[0103] At the same time, when processing the CMOS surface images to be detected, the multi-classification support vector machine also needs to consider the weight of the features. In the previous training process, different features may be assigned different weights, which reflect the importance of the features in distinguishing different categories. For example, in textiles, the roughness feature of the texture may have a higher weight when distinguishing certain types of defects (such as wear defects), while the color feature may have a higher weight when distinguishing stain defects. When classifying and detecting the CMOS surface images to be detected, these weights will affect the final judgment results. If the weight of a feature is set unreasonably, even if the feature is clearly shown in the image to be detected, it may be ignored due to the low weight, resulting in misjudgment.

[0104] In addition, when the multi-classification support vector machine calculates the relationship between the vector to be detected and the support vector, the calculation accuracy is also very important. For example, when calculating the distance, if the Euclidean distance calculation method is used, the accuracy of the calculation process will affect the accuracy of the final distance value. If the calculation accuracy is not enough, the vector to be detected that is closer to a support vector may be mistakenly judged as being closer to another support vector, thereby obtaining incorrect defect classification detection information.

[0105] It can be seen that by inputting the CMOS surface image of the target textile to be inspected into the trained multi-classification support vector machine to obtain defect classification detection information, the ability of the multi-classification support vector machine constructed and trained in the previous steps is fully utilized. This method can accurately classify and detect defects in textiles, effectively reduce misjudgments through reasonable internal structure, accurate feature processing and precise calculation relationship determination, and improve the accuracy and reliability of textile defect detection.

[0106] In the field of textile defect detection, the unique design of the multi-classification support vector machine of the present application, including stacked texture description mining branches and defect detection mapping branches, as well as further subdivided grayscale symbiosis processing modules and spectrum change recognition modules, as well as the first feature pyramid layer and the second feature pyramid layer, demonstrates many advantages and innovations.

[0107] The advantages of multi-classification support vector machines include the following three aspects.

[0108] 1) Multi-level feature extraction The stacked design of texture description mining branches enables the multi-classification support vector machine to mine the texture features of textile images from multiple levels. For example, in the first feature pyramid layer, the texture description mining branches at different levels can gradually and deeply analyze the texture of the textile. Taking a silk textile with complex texture as an example, the texture description mining branches at the lower level may first identify the macro texture direction. As the level increases, the texture description mining branches at the higher level can capture more subtle texture changes, such as the microstructure of silk fiber interweaving. This multi-level mining method is similar to the perception process of the human visual system on objects. It gradually goes deeper from the whole to the part, and can obtain more comprehensive and detailed texture information, providing a rich feature basis for subsequent defect detection.

[0109] As for the grayscale symbiosis processing module, it plays an important role in the texture description mining branches at different levels. By analyzing the symbiosis relationship of pixels at different gray levels, the roughness, directionality and other characteristics of the textile texture can be quantified. In the textile production process, different processes will cause these characteristics of the texture to change, and the grayscale symbiosis processing module can accurately capture these changes. For example, in cotton textiles, normal textures have certain grayscale symbiosis rules. When defects (such as uneven yarns) occur, this grayscale symbiosis relationship will change. Since the grayscale symbiosis processing module exists in multiple levels of texture description mining branches, it can analyze this change from different scales and depths, thereby improving the sensitivity of defect detection.

[0110] The spectral change recognition module also helps with multi-level feature extraction. In the texture of a textile, normal and defective parts will have different performances in the spectrum. For example, the spectral change recognition module can identify energy changes in specific frequency bands in the spectrum of textile texture. For textiles with holes, the energy of certain frequency bands of its spectrum may drop significantly. Spectral change recognition modules at different levels (such as in different texture description mining branches) can analyze this change at different spectral resolutions, just like observing an object with a magnifying glass of different magnifications, which can more accurately locate and identify defect-related spectral features, thereby improving the accuracy of defect detection.

[0111] 2) Effective feature conversion and mapping The existence of the defect detection mapping branch in the multi-classification support vector machine realizes the effective conversion from texture features to defect detection related features. After the texture description mining branch deeply mines the texture features of the textile image, the defect detection mapping branch can reorganize and map these texture features and convert them into feature representations directly related to defect detection. For example, for stains on the surface of textiles, the texture features may appear as uneven color of the texture and disorder of the local texture. The defect detection mapping branch can convert these texture features into features related to stain detection, such as the texture complexity of the stain area, the contrast between the stain and the surrounding normal texture, and other features. This conversion enables subsequent classification detection to more directly use these features for accurate defect classification.

[0112] The grayscale symbiosis processing module and the spectrum change recognition module also play a key role in the defect detection mapping branch. At this stage, the grayscale symbiosis processing module can readjust the analysis focus of the grayscale symbiosis relationship according to the needs of defect detection. For example, when detecting color difference defects in textiles, the grayscale symbiosis processing module can pay more attention to the symbiosis relationship of grayscale pixels related to color, thereby highlighting the characteristics of color difference defects. The spectrum change recognition module can further refine the analysis of defect-related spectral features in the defect detection mapping branch. For example, when detecting broken thread defects in textiles, the spectrum change recognition module can focus on the slight changes in the spectral frequency bands related to broken threads, convert them into feature representations that are easier to classify and identify, and improve the detection accuracy of broken thread defects.

[0113] 3) Synergistic advantages of hierarchical structure The design of the first feature pyramid layer and the second feature pyramid layer brings the advantage of collaborative work to the entire multi-classification support vector machine. The first feature pyramid layer mainly focuses on texture description mining, and deeply mines the texture features of textiles in a layer-by-layer progressive manner. The second feature pyramid layer focuses on defect detection mapping, converting and mapping the texture features obtained from the first feature pyramid layer for defect detection. This hierarchical structure makes the entire processing process more orderly and efficient. For example, when detecting multiple types of defects in textiles (such as stains, holes, color differences, etc.), the first feature pyramid layer can comprehensively mine the texture features related to these defect types, and then the second feature pyramid layer can convert these texture features into targeted defect detection features for different defect types.

[0114] There is a close information transfer and synergy relationship between the two feature pyramid layers. For example, the output of the first feature pyramid layer is used as the input of the second feature pyramid layer. This connection method ensures that the texture features can smoothly transition from the mining stage to the defect detection mapping stage. Moreover, within the second feature pyramid layer, different defect detection mapping branches can also cooperate with each other. For example, for some defect types that are difficult to distinguish individually, multiple defect detection mapping branches can improve the detection capabilities of these complex defect types by sharing the texture features of the first feature pyramid layer and complementing each other in their respective processing processes.

[0115] The innovation of multi-classification support vector machine includes the following three aspects.

[0116] 1) Unique branch stacking structure In traditional textile defect detection methods, there are few methods that stack the texture description mining branch and the defect detection mapping branch. This stacking structure enables the multi-classification support vector machine to first perform deep mining of texture features and then convert and map defect detection related features in a unified framework. Compared with traditional methods, which may treat texture analysis and defect detection as two relatively independent steps, this new stacking structure can better integrate the two processes and improve the efficiency and accuracy of the entire defect detection. For example, the traditional method may first perform a simple texture analysis on the textile image, and then use another independent model for defect detection. In this way, some information may be lost between the two steps, and the new stacking structure can avoid this information loss.

[0117] The module combination within each branch is also innovative. For example, the combination of the grayscale symbiosis processing module and the spectrum change recognition module in the texture description mining branch can analyze the texture of textiles from different angles. The grayscale symbiosis processing module focuses on the spatial relationship of pixel gray levels, and the spectrum change recognition module focuses on the spectrum characteristics of textures. The collaborative work of these two modules can more comprehensively describe the texture characteristics of textiles, which is a relatively novel design in previous textile defect detection technologies.

[0118] 2) Innovative application of feature pyramid layer The design of the first feature pyramid layer and the second feature pyramid layer is an innovative concept in the field of textile defect detection. This hierarchical pyramid structure can effectively organize and manage the mining of texture features and the defect detection mapping process. In previous technologies, there may not be such a hierarchical and progressive structure to handle textile texture and defect detection. For example, the first feature pyramid layer can gradually refine the analysis of textile texture from macro to micro through multiple layers of texture description mining branches. This hierarchical mining method is new. The second feature pyramid layer further processes the output of the first feature pyramid layer and converts the texture features into defect detection features. This hierarchical processing process is an innovation of the traditional defect detection method.

[0119] The interaction between the two feature pyramid layers is also innovative. For example, the pyramid vector of the first feature pyramid layer is used as the input of the second feature pyramid layer, and in the second feature pyramid layer, its own pyramid vector is also combined for further processing. This interaction can better utilize the texture features and defect detection mapping results at different levels and improve the performance of the entire multi-classification support vector machine.

[0120] 3) Complex combination of technical elements From the perspective of traditional textile defect detection technology, the usual design idea is to divide texture analysis and defect detection into two relatively independent parts, first perform texture analysis to obtain some simple texture features, and then perform defect detection. The multi-classification support vector machine in this technical solution stacks the texture description mining branch and the defect detection mapping branch together, and has a complex module combination and hierarchical structure inside, which is very different from the traditional idea. For the design of the feature pyramid layer, it is difficult to think of using this hierarchical pyramid structure to process the texture and defect detection of textiles without sufficient experiments and research. Traditional methods are more likely to use a planar processing structure, and this hierarchical, progressive pyramid structure requires an in-depth understanding of the nature of textile texture features and defect detection to be designed.

[0121] The various technical elements in the multi-classification support vector machine, such as the texture description mining branch, the defect detection mapping branch, the grayscale co-occurrence processing module, the spectrum change recognition module, the first feature pyramid layer and the second feature pyramid layer, etc., are combined in a very complex way. These elements are not simply stacked together, but have strict information transmission, processing flow and collaborative relationship. For example, in the texture description mining branch, the collaboration between the grayscale co-occurrence processing module and the spectrum change recognition module needs to be carefully designed, and this collaboration method will change in different levels of the first feature pyramid layer. Similarly, in the defect detection mapping branch, the relationship between each module and the interaction with the first feature pyramid layer and the second feature pyramid layer are also very complex. This complex combination method is not something that can be thought of through conventional technical improvements.

[0122] Applying the above technical solution of the present application, firstly, the stacked texture description mining branch and defect detection mapping branch structure in the multi-classification support vector machine can comprehensively and deeply process textile images. The p texture description mining branches (p≥2) perform texture recognition through the grayscale co-occurrence processing module and the spectrum change recognition module, and mine texture features from multiple dimensions to ensure the comprehensiveness and accuracy of texture description. The q defect detection mapping branches (q≥3) perform mapping processing with the same module setting, which can effectively convert texture features into defect detection related features. This structure helps to improve the detection ability of different types of defects, whether it is tiny stains, holes or color differences. Defects can be effectively identified. By comparing the defect classification authentication information and the discrimination information to optimize the algorithm variables, the detection system can continuously improve itself, improve the accuracy and reliability of detection, adapt to the detection needs of various textiles, and ensure the quality of textiles.

[0123] Further, Figure 2 Schematic diagram of the structure of a textile defect detection device 200 provided in an embodiment of the present application. Figure 2 The textile defect detection device 200 shown includes a processor 210, and the processor 210 can call and run a computer program from a memory to implement the method in the embodiment of the present application.

[0124] Alternatively, if Figure 2 As shown, the textile defect detection device 200 may further include a memory 230. The processor 210 may call and run a computer program from the memory 230 to implement the method in the embodiment of the present application.

[0125] The memory 230 may be a separate device independent of the processor 210 , or may be integrated into the processor 210 .

[0126] Alternatively, if Figure 2As shown, the textile defect detection device 200 may further include a transceiver 220, and the processor 210 may control the transceiver 220 to interact with other devices, specifically, may send information or data to other devices, or receive information or data sent by other devices.

[0127] Optionally, the textile defect detection device 200 can implement the corresponding processes corresponding to the storage engine or components in the storage engine (such as a processing module) or a device deployed with a storage engine in each method of the embodiments of the present application. For the sake of brevity, they are not repeated here.

[0128] It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities.

[0129] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. It should be noted that the memory of the systems and methods described herein is intended to include but is not limited to suitable types of memory.

[0130] Based on the above, a readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the above method are implemented.

[0131] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the present application, all of which are within the protection of the present application.

Claims

1. A method for detecting textile defects based on machine vision, characterized in that: The method is implemented by a textile defect detection device through a multi-classification support vector machine, the multi-classification support vector machine includes p stacked texture description mining branches and q stacked defect detection mapping branches, each of the texture description mining branches and each of the defect detection mapping branches includes a stacked grayscale symbiosis processing module and a spectrum change recognition module, p is a positive integer not less than 2, q is a positive integer not less than 3, and the method includes: Acquire a CMOS surface image of a textile, and input the CMOS surface image of the textile into the p texture description mining branches, and sequentially perform texture recognition through each of the p texture description mining branches to obtain surface texture description vectors generated by the p texture description mining branches; wherein each of the texture description mining branches is used to sequentially perform texture vector refinement through the grayscale symbiosis processing module and the spectrum change recognition module, and process the texture vector refinement result of the texture description mining branch through the feature transfer indication of the initial module node and the terminal module node of the grayscale symbiosis processing module; Input the surface texture description vector into the q defect detection mapping branches, and perform mapping processing in sequence through each of the q defect detection mapping branches to obtain defect detection mapping vectors generated by the q defect detection mapping branches; wherein each of the defect detection mapping branches is used to perform space vector transformation in sequence through the grayscale symbiosis processing module and the spectrum change recognition module, and process the space vector transformation result of the defect detection mapping branch through the feature transfer indication; Predicting defect classification information of the textile CMOS surface image based on the defect detection mapping vector; Based on the difference between the defect classification authentication information of the textile CMOS surface image and the defect classification discrimination information, the algorithm variables of the multi-classification support vector machine are optimized.

2. The method according to claim 1, characterized in that The multi-classification support vector machine includes w stacked first feature pyramid layers, each of the first feature pyramid layers includes at least two of the p texture description mining branches stacked, and w is a positive integer not less than 2; the textile CMOS surface image is input into the p texture description mining branches, and texture recognition is performed in sequence through each of the p texture description mining branches to obtain a surface texture description vector generated by the p texture description mining branches, including: Inputting the textile CMOS surface image into a first first feature pyramid layer, sequentially performing texture recognition through each texture description mining branch in the first first feature pyramid layer, and obtaining a pyramid vector of the first first feature pyramid layer; Inputting the pyramid vector of the u-th first feature pyramid layer into the u+1-th first feature pyramid layer, sequentially performing texture recognition through each of the texture description mining branches in the u+1-th first feature pyramid layer, to obtain the pyramid vector of the u+1-th first feature pyramid layer, where u is a positive integer and u+1 is not greater than w; The multi-classification support vector machine includes w stacked second feature pyramid layers, each of which includes at least three of the q defect detection mapping branches stacked; the surface texture description vector is input into the q defect detection mapping branches, and mapping processing is performed in sequence through each of the q defect detection mapping branches to obtain a defect detection mapping vector generated by the q defect detection mapping branches, including: Inputting the pyramid vector of the wth first feature pyramid layer into the first second feature pyramid layer, and sequentially performing mapping processing through each of the defect detection mapping branches in the first second feature pyramid layer to obtain the pyramid vector of the first second feature pyramid layer; The pyramid vector of the w-th first feature pyramid layer and the pyramid vector of the v-th second feature pyramid layer are input into the v+1-th second feature pyramid layer, and mapping processing is performed in sequence through each of the defect detection mapping branches in the v+1-th second feature pyramid layer to obtain the pyramid vector of the v+1-th second feature pyramid layer, where v is a positive integer and v+1 is not greater than w.

3. The method according to claim 2, characterized in that Each of the first feature pyramid layers includes a stacked first texture description mining branch and a second texture description mining branch, the spectrum change recognition module of the first texture description mining branch is an inter-class feature enhancement module, and the spectrum change recognition module of the second texture description mining branch is a deep convolution module; The step of inputting the pyramid vector of the u-th first feature pyramid layer into the u+1-th first feature pyramid layer, sequentially performing texture recognition through each of the texture description mining branches in the u+1-th first feature pyramid layer, and obtaining the pyramid vector of the u+1-th first feature pyramid layer includes: Inputting the pyramid vector of the u-th first feature pyramid layer into the first texture description mining branch of the u+1-th first feature pyramid layer; Mining texture elements sequentially through the grayscale symbiosis processing module and the inter-class feature enhancement module of the first texture description mining branch; The pyramid vector of the u-th first feature pyramid layer and the intermediate texture element vector of the grayscale symbiosis processing module of the first texture description mining branch are combined with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch to obtain the intermediate layer texture vector of the first texture description mining branch; Inputting the intermediate layer texture vector of the first texture description mining branch into the second texture description mining branch of the u+1th first feature pyramid layer; Performing texture enhancement sequentially through the grayscale symbiosis processing module and the deep convolution module of the second texture description mining branch; The intermediate layer texture vector of the first texture description mining branch and the texture enhancement vector of the grayscale symbiosis processing module of the second texture description mining branch are weighted by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch to obtain the pyramid vector of the u+1th first feature pyramid layer.

4. The method according to claim 3, characterized in that The step of combining the pyramid vector of the u-th first feature pyramid layer and the intermediate texture element vector of the grayscale symbiosis processing module of the first texture description mining branch with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch to obtain the intermediate layer texture vector of the first texture description mining branch includes: Determine a first feature confidence weighted result of a pyramid vector of the u-th first feature pyramid layer and a first confidence coefficient; and determine a second feature confidence weighted result of a grayscale symbiosis vector of the grayscale symbiosis processing module of the first texture description mining branch and a second confidence coefficient; Combining the first feature confidence weighted result and the second feature confidence weighted result with the feature transfer indication and the inter-class attention vector of the inter-class feature enhancement module of the first texture description mining branch; The step of weighting the intermediate layer texture vector of the first texture description mining branch and the texture enhancement vector of the grayscale symbiosis processing module of the second texture description mining branch by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch to obtain the pyramid vector of the u+1th first feature pyramid layer includes: Determine a third feature confidence weighted result of the intermediate layer texture vector of the first texture description mining branch and a third confidence coefficient; and determine a fourth feature confidence weighted result of the grayscale symbiosis vector of the grayscale symbiosis processing module of the second texture description mining branch and a fourth confidence coefficient; The third feature confidence weighted result and the fourth feature confidence weighted result are weighted by the feature transfer indication and the convolution vector of the deep convolution module of the second texture description mining branch.

5. The method according to claim 4, characterized in that The method further comprises: Based on the difference between the defect classification authentication information of the textile CMOS surface image and the defect classification discrimination information, at least one of the first confidence coefficient, the second confidence coefficient, the third confidence coefficient and the fourth confidence coefficient is adjusted.

6. The method according to any one of claims 1 to 5, characterized in that: The method further includes: performing feature annotation on the defect detection mapping vectors generated by the q defect detection mapping branches to obtain a defect detection mapping annotation vector.

7. The method according to any one of claims 2 to 5, characterized in that: Each of the second feature pyramid layers includes a stacked first defect detection mapping branch, a second defect detection mapping branch, and a third defect detection mapping branch, wherein the spectrum change recognition module of the first defect detection mapping branch is a first inter-class feature enhancement module, the spectrum change recognition module of the second defect detection mapping branch is a second inter-class feature enhancement module, and the spectrum change recognition module of the third defect detection mapping branch is a deep convolution module; The step of inputting the pyramid vector of the wth first feature pyramid layer and the pyramid vector of the vth second feature pyramid layer into the v+1th second feature pyramid layer, and sequentially performing mapping processing through each of the defect detection mapping branches in the v+1th second feature pyramid layer to obtain the pyramid vector of the v+1th second feature pyramid layer includes: Inputting the pyramid vector of the v-th second feature pyramid layer into the first defect detection mapping branch of the v+1-th second feature pyramid layer; Linear mapping is performed sequentially through the grayscale symbiosis processing module and the first inter-class feature enhancement module of the first defect detection mapping branch; The pyramid vector of the v-th second feature pyramid layer and the grayscale symbiosis vector of the grayscale symbiosis processing module of the first defect detection mapping branch are summed with the inter-class attention vector of the first inter-class feature enhancement module of the first defect detection mapping branch through the feature transfer indication to obtain a detection mapping decision vector of the first defect detection mapping branch; Inputting the pyramid vector of the w-th first feature pyramid layer and the detection mapping decision vector of the first defect detection mapping branch into the second defect detection mapping branch of the v+1-th second feature pyramid layer; sequentially processed by the grayscale symbiosis processing module and the second inter-class feature enhancement module of the second defect detection mapping branch; The detection mapping decision vector of the first defect detection mapping branch and the grayscale symbiosis vector of the grayscale symbiosis processing module of the second defect detection mapping branch are summed by the feature transfer indication and the inter-class attention vector of the second inter-class feature enhancement module of the second defect detection mapping branch to obtain a detection mapping decision vector of the second defect detection mapping branch; Inputting the detection mapping decision vector of the second defect detection mapping branch into the third defect detection mapping branch of the v+1th second feature pyramid layer; Processing in sequence through the grayscale symbiosis processing module and the depth convolution module of the third defect detection mapping branch; The detection mapping decision vector of the second defect detection mapping branch and the grayscale symbiosis vector of the grayscale symbiosis processing module of the third defect detection mapping branch are summed with the convolution vector of the deep convolution module of the third defect detection mapping branch through the feature transfer indication to obtain the pyramid vector of the v+1th second feature pyramid layer.

8. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: On the basis that the number of cycle debugging of the multi-classification support vector machine is not greater than the first set number of times, the statistical value of the algorithm variable optimized by the multi-classification support vector machine in each cycle is set not to exceed the statistical threshold value; On the basis that the number of loop debugging times of the multi-classification support vector machine is not less than a second set number value, the setting of the statistical threshold value is canceled, and the second set number value is greater than the first set number value.

9. The method according to claim 1, characterized in that The method further comprises: inputting the to-be-detected CMOS surface image of the target textile into the multi-classification support vector machine to obtain defect classification detection information corresponding to the to-be-detected CMOS surface image.

10. A textile defect detection device, characterized in that: The method comprises at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1 to 9.