Textile fabric flaw high-precision detection method and system based on AI vision
By acquiring pattern design and fabric structure data, calculating texture phase features, and performing image alignment and resampling, fabric feasibility constraints are generated. This enables high-precision defect detection under conditions of frequent pattern changes in jacquard and complex fabrics, solving the problems of false alarms and missed detections, and improving the stability and accuracy of detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU XINJINGYUAN TEXTILE TECH CO LTD
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-12
AI Technical Summary
In production lines where jacquard and complex fabrics undergo frequent style changes and defect samples are scarce, existing technologies struggle to achieve stable and high-precision detection of structural defects, and are prone to false alarms and missed detections due to pattern changes, leading to loss of control.
By acquiring floral design data and organizational structure data, calculating texture phase features, performing image alignment and resampling, generating organizational feasibility constraints, performing consistency verification, and outputting defect detection results.
Under conditions of frequent model changes and scarce defect samples, this method suppresses false alarms caused by pattern mutations, alleviates missed detections and loss of control, and improves the stability and accuracy of defect detection.
Smart Images

Figure CN122199464A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of online quality inspection technology for textile fabrics, and more specifically, to a high-precision detection method and system for textile fabric defects based on AI vision. Background Technology
[0002] In the field of visual inspection of textile fabric defects, the mainstream practice in the industry is to solve the problem of quickly detecting problems such as broken warp, floating weft, missing needles and snags on the production line. Usually, industrial cameras are used to continuously collect images of the fabric surface, and then template comparison, texture feature matching or supervised learning models are used to locate and judge the images. Finally, alarms and graded results are output according to thresholds. However, on production lines with highly variable patterns, such as jacquard and double-layer weave, multiple pattern changes are often performed within a single day. New patterns have almost no defective samples, and the production line does not allow for strict constraints such as downtime for data collection to build a database. At the same time, the pattern design itself introduces a large number of normal local mutations and non-repeating textures. This causes mainstream methods to consistently reveal verifiable bottlenecks in the field: The same model, which was just set up to be usable on the previous fabric, will generate a lot of false alarms when it is switched to the next fabric, mistaking normal pattern mutations as defects, or missing the real defects as pattern changes. On-site, it is often only possible to barely restore usability by re-collecting, re-labeling, re-training, or significantly adjusting the threshold. The reason is that these methods mainly rely on the similarity of image appearance to define normal, and lack constraints on what structural changes are allowed in the current pattern. Therefore, they cannot maintain stable discrimination ability under the condition of scarce defect samples and frequent pattern changes. The technical problem this application aims to solve is how to achieve stable and high-precision detection of structural defects on production lines where jacquard and complex fabrics are frequently changed and defect samples are scarce, while avoiding image matching issues caused by a surge in false alarms or uncontrolled missed detections due to pattern changes. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a high-precision detection method and system for textile fabric defects based on AI vision. The method completes image alignment standardization by establishing phase coordinates and uses the feasibility constraints of pattern and fabric generation as a judgment criterion for consistency verification. This allows for stable detection of structural defects under conditions of frequent style changes and scarce defect samples, and relatively suppresses false alarms and missed detections caused by pattern mutations, thereby solving the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a high-precision detection method for textile fabric defects based on AI vision, comprising: S1. Obtain the pattern design data and fabric structure data corresponding to the current production batch, and obtain the target fabric surface image sequence continuously collected by the industrial camera on the production line. The pattern design data and fabric structure data are used as design prior inputs, and the fabric surface image sequence is used as the input to be detected. S2. Calculate the warp and weft texture phase features of the target fabric based on the fabric image sequence, and output the fabric coordinate feature field to characterize the local positional relationship of the fabric in the warp and weft directions. S3. Based on the fabric coordinate feature field, the fabric image sequence is aligned and resampled to output a standardized fabric representation consistent with the fabric coordinates, so as to eliminate the influence of geometric deformation caused by tension changes and weft skew. S4. Generate and standardize the fabric surface representation based on pattern design data and fabric structure data to represent the fabric feasibility constraint representation under the same fabric coordinates, and output the feasibility judgment benchmark used to limit the allowable range of fabric variation; S5. Verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. S6. Generate defect detection results based on the set of violation locations and their degree of violation, and output the location information and category or grade information of the defects.
[0005] In a preferred embodiment, S1 includes: S1-1. Input is the pattern file source data of the current production batch. The pattern file source data is parsed according to the preset field rules to extract the pattern unit number set and its arrangement relationship in the warp and weft directions, and the pattern design data is output. S1-2. The input is the pattern design data. The pattern unit number set is calculated by looking up the table unit by unit according to the preset organization rule table to determine the warp and weft interlacing parameter set corresponding to each pattern unit. The output is the organization structure data, where the organization rule table gives the mapping relationship between the pattern unit number and the warp and weft interlacing parameter set. S1-3. The input is the raw image stream and pattern design data continuously acquired by the industrial camera on the production line. Continuous frames are extracted from the raw image stream according to the preset cropping rules and associated with the pattern unit number set according to the preset sorting rules to form a fabric image sequence. The output is the fabric image sequence to be detected.
[0006] In a preferred embodiment, S2 includes: S2-1. The input is a sequence of fabric images. Each frame of the fabric image is divided into blocks according to a preset window size. For each image block, the principal period estimation operation is performed in the warp and weft directions to obtain the warp principal period and the weft principal period. The output is the warp principal period diagram and the weft principal period diagram corresponding to each image block. S2-2. The input is the warp principal periodic image and the weft principal periodic image. For each image block, perform phase accumulation operation along the corresponding direction to generate the warp phase value and the weft phase value. Then, stitch the warp phase value and the weft phase value according to their position in the fabric image to output the warp texture phase field and the weft texture phase field. S2-3. The input is the warp texture phase field and the weft texture phase field. The warp texture phase field and the weft texture phase field are subjected to consistency constraint smoothing to suppress local noise and maintain phase continuity. The output is the cloth coordinate feature field, which is composed of the warp texture phase field and the weft texture phase field.
[0007] In a preferred embodiment, S3 includes: S3-1. The input is a sequence of fabric images and a fabric coordinate feature field. The inter-frame displacement field is calculated based on the warp and weft phase differences of the fabric coordinate feature field between adjacent frames. The output is the inter-frame displacement field corresponding to each adjacent frame pair. S3-2. The input is the inter-frame displacement field. The inter-frame displacement field is subjected to anomaly removal according to the preset confidence rules to remove phase jump points and interpolation is performed to complete the missing regions. The output is the inter-frame displacement field after anomaly removal and completion. S3-3. The input is the inter-frame displacement field after anomaly removal and completion. The inter-frame displacement field is processed by displacement accumulation operation in time order to generate the cumulative displacement field of each frame relative to the reference frame. The output is the cumulative displacement field sequence.
[0008] In a preferred embodiment, S3 further includes: S3-4. The input is the cumulative displacement field sequence and the fabric image sequence. Based on the cumulative displacement field sequence, the coordinate transformation is performed on each frame of the fabric image to map each frame to the fabric coordinate system of the reference frame. The output is the aligned fabric image sequence. S3-5. The input is an aligned fabric image sequence. The aligned fabric image sequence is resampled on a preset fabric coordinate grid to ensure that each frame has a consistent fabric coordinate resolution. The output is a standardized fabric representation consistent with the fabric coordinates.
[0009] In a preferred embodiment, S4 includes: S4-1. The input is pattern design data and weave structure data. According to the preset parsing rules, the pattern design data is decomposed into a set of pattern units with fabric coordinate index and the weave structure data is decomposed into a set of interlacing parameters with pattern unit number index. The output is a set of constraint atoms from pattern units to interlacing parameters. S4-2. The input is a set of constraint atoms and a standardized fabric representation. The warp and weft phase fields on the fabric coordinate grid are extracted from the standardized fabric representation as alignment evidence. The alignment evidence is written into the alignment evidence table to generate the first gating token. The output is an evidence package containing the first gating token. S4-3. The input is an evidence package and a set of constraint atoms. The consistency checker is called to perform organizational feasibility consistency check on each fabric coordinate position and generate a feasibility score field and an uncertainty field. The feasibility score field and uncertainty field are written into the feasibility score map to form the second gating token. The output is a score package containing the second gating token.
[0010] In a preferred embodiment, S4 further includes: S4-4. The input is a scoring package. Within the preset time series window, the feasibility scoring field is propagated and the uncertainty field is updated with confidence decay to obtain the updated scoring field and the updated uncertainty field. The updated scoring field and the updated uncertainty field are written into the time series scoring cache and a state lock is generated. The output is a time series scoring package with a state lock. S4-5. The input is a time-series scoring package with state lock and a standardized fabric representation. According to the preset conflict resolution rules, the updated scoring fields of the same fabric coordinate position across frames are branched and merged to form the final feasibility scoring field. When the rollback trigger condition is met, a rollback flag is written and a re-examination action is triggered to update the alignment evidence table. The output is the organization feasibility constraint representation and feasibility judgment benchmark. S4-6. The input is the organizational feasibility constraint representation and the feasibility judgment benchmark. The constraint fields and gate token fields used to limit the scope of allowed organizational changes in the organizational feasibility constraint representation are written into the constraint set storage area for use in step S5. The output is the callable feasibility judgment benchmark.
[0011] In a preferred embodiment, S5 includes: S5-1. The input is a standardized fabric representation and a fabric feasibility constraint representation. The constraint field and gate token field in the fabric feasibility constraint representation are read according to the fabric coordinate position. The observation field corresponding to the fabric coordinate position is extracted from the standardized fabric representation to form a position-level verification record. The output is a set of position-level verification records. S5-2. The input is a set of location-level verification records. The consistency checker is called to perform constraint satisfaction calculation on each location-level verification record to obtain the violation score field. Based on the gate token field and the preset threshold packet, the violation score field is gating to generate the violation flag and violation level fields. The output is a set of violation records containing the violation flag and violation level fields. S5-3. The input is a set of violation records. According to the preset aggregation rules, the locations with violation marks are connected and aggregated, and the violation level field is summarized at the regional level to generate a set of violation locations and a representation of the degree of violation. The set of violation locations and the representation of the degree of violation are written into the result cache for use in step S6. The set of violation locations and the representation of the degree of violation are output.
[0012] In a preferred embodiment, S6 includes: S6-1. The input is a set of violation locations and their degree of violation. According to the preset defect spectrum mapping table, the violation feature field of each violation location is jointly mapped with the constraint field in the organization feasibility constraint representation to generate candidate defect category field and candidate defect level field. The output is a set of candidate defect records. S6-2. The input is a set of candidate defect records. Within the preset time window, the candidate defect records in the same fabric coordinate area are subjected to consistency fusion to update the candidate defect level field and calculate the stability score field. When the false alarm suppression gating condition is met, a suppression flag is written to filter the candidate defect records caused by normal mutation of the pattern. The output is the set of defect records after fusion and gating. S6-3. The input is the set of defect records after fusion and gating. The location information and category or level information of the defect are generated for the retained defect records and written into the defect detection result cache. The output is the defect detection result.
[0013] In a preferred embodiment, the AI vision-based high-precision textile fabric defect detection system includes a priori acquisition module, a phase calculation module, a coordinate normalization module, a constraint generation module, a consistency verification module, and a result output module. The prior acquisition module is used to acquire the pattern design data and fabric structure data corresponding to the current production batch, and to acquire the target fabric surface image sequence continuously acquired by the industrial camera on the production line. The pattern design data and fabric structure data are used as the design prior input, and the fabric surface image sequence is used as the input to be detected. The phase calculation module calculates the warp and weft texture phase features of the target fabric based on the fabric image sequence and outputs the fabric coordinate feature field, which is used to characterize the local positional relationship of the fabric in the warp and weft directions. The coordinate normalization module performs coordinate alignment and resampling on the fabric image sequence based on the fabric coordinate feature field, and outputs a standardized fabric representation consistent with the fabric coordinates to eliminate the influence of geometric deformation caused by tension changes and weft skew. The constraint generation module generates a feasibility constraint representation of the fabric structure under the same fabric coordinates as the pattern design data and the fabric structure data, and outputs a feasibility judgment benchmark to limit the allowable range of fabric changes. The consistency verification module is used to verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. The output module generates defect detection results based on the set of violation locations and their degree of violation, outputting the location information and category or grade information of the defects.
[0014] The technical effects and advantages of this invention are as follows: After constructing fabric coordinates based on phase and aligning resampling to achieve image matching, and then introducing organizational feasibility constraints for consistency verification, it can relatively suppress false alarms of pattern mutations and relatively alleviate the loss of control due to frequent style changes and scarce defect samples. By parsing the pattern file and mapping the organization rule table to form design priors and binding them to batch image sequences, a feasibility judgment benchmark can be directly generated when changing styles, reducing the reliance on re-collecting, labeling, training, or significantly adjusting thresholds. By using the phase of the longitudinal and latitudinal textures to calculate the inter-frame displacement and accumulate it to obtain a unified reference coordinate, the impact of tension fluctuations and latitudinal skew on the consistency of subsequent judgments can be relatively weakened. By mapping allowable interlacing, prohibited interlacing, and tolerance constraints to fabric coordinates and calculating violation scores and violation levels, the detection judgment can be transformed from appearance similarity to structural feasibility, thus improving the interpretability and reproducibility of structural anomaly location. By combining gate tokens and threshold packets to gating the violation score and outputting the violation degree through connectivity aggregation and region summarization, the single-point noise triggering can be relatively suppressed and the output result can be more adapted to subsequent graded processing. By combining the mapping of violation areas and constraint fields using the defect spectrum mapping table and fusing and suppressing false alarms within the time window, the stability of defect category and grade output can be relatively improved and invalid alarms caused by short-term fluctuations can be reduced. Attached Figure Description
[0015] Figure 1 This is a flowchart of the present invention.
[0016] Figure 2 This is a schematic diagram of the system modules of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Refer to the instruction manual appendix Figure 1-2 The present invention provides a high-precision detection method for textile fabric defects based on AI vision, comprising: S1. Obtain the pattern design data and fabric structure data corresponding to the current production batch, and obtain the target fabric surface image sequence continuously collected by the industrial camera on the production line. The pattern design data and fabric structure data are used as design prior inputs, and the fabric surface image sequence is used as the input to be detected. This embodiment provides an implementable data acquisition and processing flow for step S1. Its purpose is to parse the prior designs and fabric structures of the same production batch into computable fields, and to organize the raw image stream continuously acquired by the industrial camera into a fabric image sequence bound to that batch. This ensures that subsequent steps can run seamlessly under a unified batch identifier, unified field caliber, and executable value rules. The flow first parses the pattern file to obtain the pattern unit number and its warp and weft arrangement relationship. Then, based on the fabric rule table, it obtains the warp and weft interlacing parameter set corresponding to each pattern unit. Finally, it extracts and sorts the raw image stream by batch window and writes it into the sequence metadata to complete batch binding. This implementation process includes the following steps: S1-1. The input for this step is the source data of the pattern file for the current production batch. First, read the pattern unit number field, warp arrangement field, and weft arrangement field according to the preset field rules. The preset field rules include at least the field position rules and the field type conversion rules. Then, form a pattern unit number set according to the order of appearance of the pattern unit numbers, and write the warp index and weft index corresponding to each pattern unit number into the arrangement relationship table. Output the pattern design data containing the batch identifier field, the pattern unit number set, and the arrangement relationship table. S1-2. The input for this step is the pattern design data and the preset organization rule table. The organization rule table is looked up unit by unit according to the pattern unit number set to obtain the warp and weft interlacing parameter set, and the warp and weft interlacing parameter set that is matched by the table is written into the organization mapping table. When a pattern unit number is not matched, the default organization parameter or the organization parameter of the adjacent number is selected from the organization rule table according to the preset backtracking rule and a mismatch mark is written. The output is the organization structure data containing the batch identifier field and the organization mapping table, where the organization rule table gives the mapping relationship from the pattern unit number to the warp and weft interlacing parameter set. S1-3. The input for this step is the raw image stream continuously acquired by the industrial camera and the pattern design data. First, the acquisition window is determined according to the batch identifier, and continuous frames are extracted from the raw image stream according to the preset extraction rules to form a candidate frame set. The preset extraction rules include at least the sampling rule of taking frames at fixed intervals and the validity rule of removing abnormal frames according to the brightness range and sharpness index. Then, the candidate frame set is sorted in ascending order by timestamp according to the preset sorting rules to form a fabric image sequence. The batch identifier field and the pattern unit number set are written into the sequence metadata of the fabric image sequence, and the output is the fabric image sequence to be detected. Through the above embodiments, step S1 can parse the pattern design data and weave structure data into defined fields on a batch basis and bind them to the fabric image sequence. This allows subsequent steps to obtain consistent prior and input to be detected without relying on defect samples under conditions of frequent style changes. Furthermore, the executability and stability of the on-site operation are ensured through miss rollback and abnormal frame removal. In practical applications: when the production line continuously produces multiple jacquard fabrics in the same shift, each fabric imports the corresponding pattern file and weave rule table and generates a batch identifier upon startup. Step S1-1 outputs the set of pattern unit numbers and warp and weft arrangement relationships for this batch. Step S1-2 outputs the set of warp and weft interlacing parameters corresponding to each pattern unit in this batch. Step S1-3 extracts and sorts the fabric image sequence from the original image stream of the industrial camera within the batch acquisition window and writes it into the batch identifier and the set of pattern unit numbers, thereby providing a consistent input that can be directly called for subsequent phase calculation and coordinate normalization.
[0019] S2. Calculate the warp and weft texture phase features of the target fabric based on the fabric image sequence, and output the fabric coordinate feature field to characterize the local positional relationship of the fabric in the warp and weft directions. This embodiment provides an implementable process for calculating the warp and weft texture phases in step S2. Its purpose is to extract phase information from the fabric image sequence obtained in step S1 that can stably represent the relationship between the warp and weft texture periods and positional progression, and to organize this phase information into a fabric coordinate feature field so that subsequent step S3 can calculate inter-frame displacement and complete coordinate alignment accordingly. This process uses a block-based approach to ensure that local periods are estimable. First, the main warp and weft periods are obtained. Then, the phase progression is constrained by the main periods to obtain the warp and weft texture phase fields. Finally, the fabric coordinate feature field is formed by smoothing and suppressing noise and correcting jump points through consistency constraints. This implementation process includes the following steps: S2-1. The input for this step is a sequence of fabric images. Grayscale conversion and brightness normalization are performed on each frame of the fabric image to reduce exposure fluctuations. Then, the image is divided into blocks according to a preset window size and a preset overlap ratio is set to reduce the discontinuity of the block boundaries. For each image block, the principal period estimation operation is performed in the warp and weft directions to obtain the warp principal period and the weft principal period. The principal period estimation operation uses directional projection to obtain a one-dimensional texture curve and uses the main peak spacing as the principal period. The warp principal period and the weft principal period of each image block are written into the warp principal period map and the weft principal period map according to their positions and output. S2-2. The inputs for this step are the meridional principal periodic map and the zonal principal periodic map. A phase reference point is set for each image block, and phase accumulation operation is performed along the meridional and zonal directions to generate meridional phase values and zonal phase values. The phase accumulation operation converts the scanning position into the phase advance amount according to the principal period of the corresponding direction and accumulates it to obtain the phase value. In the overlapping area of the blocks, the phase values are fused according to the weighted fusion rule to reduce the stitching jump, so that the meridional phase values and zonal phase values are stitched together according to the position to output the meridional texture phase field and the zonal texture phase field. S2-3. The input for this step is the warp texture phase field and the weft texture phase field. The warp texture phase field and the weft texture phase field are subjected to consistency constraint smoothing to suppress local noise and maintain phase continuity. The consistency constraint includes at least that the phase difference between adjacent positions does not exceed a preset jump threshold. When the phase difference exceeds the preset jump threshold, the corresponding position is marked as a phase anomaly point and the phase value is corrected according to the neighborhood interpolation rule. The final output is a fabric coordinate feature field containing the warp phase field, the weft phase field and the phase anomaly mark field. Through the above embodiments, step S2 can obtain spatially continuous warp and weft phase information under the conditions of brightness fluctuation and local texture disturbance. By overlapping fusion and consistency constraint smoothing, it is ensured that the phase field can be directly used for subsequent inter-frame displacement calculation and coordinate alignment, thus providing an executable input basis for stable detection in frequent pattern change scenarios. In practical applications: after the industrial camera continuously acquires the fabric image sequence, the warp principal period map and the weft principal period map are calculated in blocks. Then, phase accumulation and fusion are performed on each block with principal period constraints to obtain the warp texture phase field and the weft texture phase field. Finally, phase anomalies are detected and corrected according to the jump threshold to form the fabric coordinate feature field. Subsequent steps can calculate the displacement based on the phase difference between adjacent frames and map the fabric image to a unified fabric coordinate system.
[0020] S3. Based on the fabric coordinate feature field, the fabric image sequence is aligned and resampled to output a standardized fabric representation consistent with the fabric coordinates, so as to eliminate the influence of geometric deformation caused by tension changes and weft skew. This embodiment provides an implementable coordinate alignment and resampling process for step S3. Its purpose is to utilize the fabric coordinate feature field output in step S2 to map each frame in the fabric image sequence to the same fabric coordinate system. This transforms the non-uniform geometric deformation between frames caused by tension changes and weft skew into compensable displacement differences. Furthermore, a standardized fabric representation is obtained by resampling on a unified fabric coordinate grid, enabling subsequent steps S4 to S6 to perform constraint generation, consistency verification, and result output under the same coordinate system. The process first calculates the inter-frame displacement field based on the warp and weft phase differences between adjacent frames. Then, confidence elimination and interpolation are performed on the displacement field to ensure its usability. Subsequently, the cumulative displacement field of each frame relative to the reference frame is accumulated in chronological order. Based on this, coordinate transformation is performed on each frame to complete alignment. Finally, a standardized fabric representation is output by resampling on a preset fabric coordinate grid. This implementation process includes the following steps: S3-1. The input for this step is the fabric image sequence and the fabric coordinate feature field. First, read the warp phase field and weft phase field at the same pixel position between adjacent frames and calculate the warp phase difference and weft phase difference. Then, convert the warp phase difference and weft phase difference into warp displacement components and weft displacement components according to the principal period scale of their respective directions. The principal period scale is taken from the warp principal period map and weft principal period map obtained in step S2 or the period field carried by the fabric coordinate feature field. Combine the warp displacement components and weft displacement components into an inter-frame displacement field and output it according to adjacent frame pairs. S3-2. The input for this step is the inter-frame displacement field. The inter-frame displacement field is anomaly-removed according to preset confidence rules, and interpolation is performed to complete the missing regions. The preset confidence rules include at least the following: when the phase anomaly marker field is anomaly, the corresponding displacement is set to missing; when the displacement amplitude exceeds a preset amplitude threshold, the corresponding displacement is set to missing; when the local displacement discontinuity exceeds a preset discontinuity threshold, the corresponding displacement is set to missing. The missing regions are filled with displacement according to the neighborhood interpolation rules. The neighborhood interpolation rules preferably take the effective displacement components in the preset neighborhood around the missing region for weighted interpolation and keep the displacement field smooth and continuous in space. The output is the inter-frame displacement field after anomaly removal and completion. S3-3. The input for this step is the inter-frame displacement field after anomaly removal and completion. The inter-frame displacement field is subjected to displacement accumulation operation in time order to generate the cumulative displacement field of each frame relative to the reference frame. The reference frame is selected as the first frame of the cloth image sequence or the frame with the highest displacement confidence within a preset time window. The cumulative displacement field of each frame is written into the cumulative displacement field sequence output to ensure that the subsequent coordinate transformation has a unified reference coordinate. S3-4. The input for this step is the cumulative displacement field sequence and the fabric image sequence. Based on the cumulative displacement field corresponding to each frame, a pixel-by-pixel coordinate transformation is performed on the fabric image of the frame to map the frame to the fabric coordinate system of the reference frame. The coordinate transformation method is to look up the source image position for each target position in the reference coordinate system and obtain the pixel value by bilinear interpolation, thereby obtaining the aligned fabric image sequence. At the position where the mapping produces holes, the neighboring area filling rule is used to fill the holes to ensure the continuity of the image. S3-5. The input for this step is the aligned fabric image sequence. The aligned fabric image sequence is resampled on a preset fabric coordinate grid to ensure that each frame has a consistent fabric coordinate resolution. The grid spacing of the preset fabric coordinate grid is either a preset ratio of the warp principal period to the weft principal period or the pixel spacing corresponding to the yarn density set in the process. During resampling, each frame is mapped to the same grid according to a unified interpolation rule to output a standardized fabric representation consistent with the fabric coordinates. Through the above embodiments, step S3 can convert the inter-frame geometric deformation caused by tension changes and weft skew into calculable displacements and complete compensation, so that the fabric image sequence is aligned under a unified fabric coordinate system. This makes the subsequent constraint generation and consistency verification no longer affected by working condition fluctuations. Furthermore, the availability and stability of the displacement field are improved by confidence elimination and interpolation completion, and finally a standardized fabric representation with consistent resolution and direct comparison is obtained. In practical applications: when tension fluctuations occur during production line operation, causing stretching and skewing changes in the fabric within the camera's field of view, the inter-frame displacement field is first calculated from the warp and weft phase differences of adjacent frames. Then, the phase abnormal positions and displacement abrupt positions are eliminated and the continuous displacement field is obtained by neighborhood interpolation completion. Subsequently, the cumulative displacement field of each frame relative to the reference frame is accumulated, and each frame is back-mapped to the reference frame coordinates to complete alignment. Finally, a standardized fabric representation is uniformly resampled and output on a preset fabric coordinate grid, so that subsequent steps can stably locate defects under the same coordinate system without being introduced by tension and weft skew disturbances into false alarms or missed alarms.
[0021] S4. Generate and standardize the fabric surface representation based on pattern design data and fabric structure data to represent the fabric feasibility constraint representation under the same fabric coordinates, and output the feasibility judgment benchmark used to limit the allowable range of fabric variation; This embodiment provides an implementable organizational feasibility constraint generation process for step S4. Its purpose is to transform the pattern design data and organizational structure data obtained in step S1 into constraint fields that can be called position-by-position in the fabric coordinate system, and to establish a correspondence with the standardized fabric representation output in step S3 under the same fabric coordinate system, thereby forming a feasibility judgment benchmark for subsequent consistency verification in step S5. The basic principle of this process is to first decompose the pattern unit and warp and weft interlacing parameters into constraint atoms and map them to the fabric coordinate grid. Then, alignment evidence is extracted from the standardized fabric representation to verify whether the prior and the current fabric are consistent. Subsequently, in the consistency checker, a feasibility score and uncertainty are calculated for each fabric coordinate position, and a gating token is generated. Then, propagation updates and conflict resolution are performed within the time window, and a rollback re-check is triggered when necessary to correct the alignment evidence table. Finally, the organizational feasibility constraint representation and feasibility judgment benchmark are output and written to the constraint set storage area for retrieval. This implementation process includes the following steps: S4-1. The input for this step is pattern design data and weave structure data. First, the pattern design data is expanded into a set of pattern units indexed by fabric coordinates according to preset parsing rules. The fabric coordinate index is determined by the fabric coordinate grid represented by the standardized fabric surface and represented by the warp and weft indices. Then, the weave structure data is expanded into a set of interlacing parameters indexed by pattern unit number. The interlacing parameter set contains at least the set of allowed interlacing states and the set of prohibited interlacing states for the pattern unit, as well as a tolerance field. Subsequently, the pattern unit set and the interlacing parameter set are associated according to the pattern unit number to generate a set of constraint atoms from the pattern unit to the interlacing parameters. Each constraint atom is written into a constraint atom table. The constraint atom table contains at least the fabric coordinate index field, the pattern unit number field, the allowed interlacing field, the prohibited interlacing field, and the tolerance field, thereby outputting the set of constraint atoms. S4-2. The input for this step is the constrained atom set and the standardized fabric representation. The warp and weft phase fields are extracted from the standardized fabric representation according to the fabric coordinate grid. Alignment evidence is generated using phase continuity and phase anomaly marker fields. The alignment evidence includes at least three fields: phase continuity coverage, phase anomaly ratio, and phase gradient stability. The alignment evidence is written into the alignment evidence table and a first gating token is generated according to the preset gating rules. The preset gating rules include at least generating a pass token when the phase continuity coverage is not lower than a preset coverage threshold and the phase anomaly ratio is not higher than a preset anomaly threshold; otherwise, a correction token is generated. The output is an evidence package containing the first gating token and the alignment evidence table index field to ensure that subsequent consistency checks are performed when evidence is available and a fallback path is triggered when evidence is insufficient. S4-3. The input for this step is the evidence package and the set of constraint atoms. The consistency checker is called to perform organizational feasibility consistency check on each fabric coordinate position to generate a feasibility score field and an uncertainty field. The organizational feasibility consistency check is performed by reading the allowed interleaving field, prohibited interleaving field and tolerance field of the corresponding constraint atom for each fabric coordinate position, and reading the observation field of the position from the standardized fabric representation as a reference. Then, the degree to which the observation field falls within the allowed interleaving range is calculated according to the preset scoring function to obtain the feasibility score field. At the same time, the uncertainty field is calculated according to the first gating token, the confidence of the observation field and the phase anomaly marker field. The feasibility score field and the uncertainty field are written into the feasibility scoring map according to the fabric coordinate position and a second gating token is generated. The second gating token generates a pass token when the effective coverage of the feasibility scoring map meets the preset effective threshold and the mean uncertainty is not higher than the preset uncertainty threshold. Otherwise, an update token that needs to be propagated is generated and the score package containing the second gating token is output. S4-4. The input for this step is a scoring package. Within a preset time window, the feasibility scoring field is propagated and the uncertainty field is updated with confidence decay to obtain the updated scoring field and the updated uncertainty field. The preset time window contains several consecutive frames of standardized fabric representation. The propagation update is weighted and summarized across frames according to the same fabric coordinate position, and the adjacent fabric coordinate positions are smoothed according to the neighborhood rule to suppress isolated fluctuations. The confidence decay update is based on the uncertainty field increasing over time, and the weight of positions with persistently high uncertainty is increased to mark unstable areas. The updated scoring field and the updated uncertainty field are written to the time-series scoring cache and a state lock is generated. The state lock is used to prevent the alignment evidence table from being rewritten by non-backtracking paths during the validity period of the state lock. The output is a time-series scoring package with a state lock. S4-5. The input for this step is a time-series scoring package with state lock and a standardized fabric representation. The updated scoring fields at the same fabric coordinate position across frames are branched and merged according to preset conflict resolution rules to form the final feasibility scoring field. The preset conflict resolution rules include, at least, prioritizing the branch with the lower uncertainty field and writing the conflict flag into the conflict record when the difference in the updated scoring fields at the same position in different frames exceeds a preset conflict threshold. When the rollback trigger condition is met, a rollback flag is written and a re-examination action is triggered to update the alignment evidence table. The rollback trigger condition includes, at least, the first gating token being a token to be corrected, the conflict flag ratio exceeding a preset ratio threshold, or the average uncertainty exceeding a preset threshold. The re-examination action includes, at least, re-extracting the warp and weft phase fields and recalculating the alignment evidence to replace the corresponding batch records in the alignment evidence table. The output is an organizational feasibility constraint representation and a feasibility judgment benchmark. The organizational feasibility constraint representation includes at least a constraint atomic table index field, a final feasibility scoring field, an uncertainty field, and a conflict flag field. The feasibility judgment benchmark includes at least a gating token field, a threshold package version field, and an effective coverage field. S4-6. The input for this step is the organizational feasibility constraint representation and the feasibility judgment benchmark. The allowed interlacing field, prohibited interlacing field, tolerance field and gate token field used to limit the range of allowed organizational changes in the organizational feasibility constraint representation are written into the constraint set storage area and bound to the batch identifier field. At the same time, the feasibility judgment benchmark is written into the feasibility benchmark table for step S5 to call according to the fabric coordinate position. The callable feasibility judgment benchmark is output. Through the above embodiments, step S4 can transform pattern design data and fabric structure data into fabric constraint fields under the same fabric coordinates as the standardized fabric representation. By using alignment evidence, gating tokens, time-series propagation updates, conflict resolution, and rollback / re-examination mechanisms, it ensures that constraints can still be stably generated under fluctuating field data. This allows subsequent consistency verification to be performed under clear feasibility judgment criteria, thereby suppressing the misjudgment of normal pattern mutations as defects and improving the stability of structural anomaly detection in frequent pattern change scenarios. In practical applications: when a batch of jacquard fabric is launched after a pattern change, step S4-1 expands the pattern units of that batch according to fabric coordinates and generates allowable interweaving, prohibited interweaving, and tolerance fields for each pattern unit to form a constraint atomic table. S4-2 Extracts the warp and weft phase fields from the standardized fabric representation, calculates the phase continuity coverage and the proportion of phase outliers, and generates the first gating token. S4-3 Calculates the feasibility score and uncertainty by comparing the observed fields position by position in the consistency checker and generates the second gating token. S4-4 Propagates and updates the score and uncertainty over several consecutive frames and locks them. S4-5 Resolves cross-frame score conflicts and triggers a rollback and re-examination to update the alignment evidence table when evidence is insufficient. Finally, S4-6 Writes the organizational feasibility constraint representation and feasibility judgment benchmark into the constraint set storage area for direct call by step S5, so that this batch can still obtain an executable organizational feasibility judgment benchmark under the condition of scarce defect samples.
[0022] S5. Verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. This embodiment provides an implementable consistency verification process for step S5. Its purpose is to compare the standardized fabric representation output in step S3 with the organizational feasibility constraint representation output in step S4 position by position under a unified fabric coordinate system. Based on the feasibility judgment criteria, the violation score and violation level of each position are calculated, ultimately forming a set of violation positions and their degree of violation characterization for subsequent grading and localization. This process first constructs position-level verification records to fix the input field calibrators, then calculates the constraint satisfaction in the consistency verifier and combines gating tokens and threshold packets to complete the gating judgment. Finally, discrete violation points are aggregated into regions according to connectivity rules and summarized to obtain a region-level violation degree characterization. This implementation process includes the following steps: S5-1. The input for this step is the standardized fabric representation and the weave feasibility constraint representation. Read the allowed interweaving field, prohibited interweaving field, tolerance field, and gate token field from the weave feasibility constraint representation according to the fabric coordinate position. Extract the observation field of the same fabric coordinate position from the standardized fabric representation to form a position-level verification record. The observation field shall at least include the warp phase field, the weft phase field, and the local texture response field calculated in the preset neighborhood. Write the above fields into the verification record table according to the fabric coordinate index and output the position-level verification record set. S5-2. The input for this step is a set of location-level verification records. The consistency checker is called to perform constraint satisfaction calculation on each location-level verification record to obtain the violation score field. The constraint satisfaction calculation measures the degree of matching between the observed field and the allowed interleaving field under the limitation of the tolerance field, and adds a penalty for cases falling into the prohibited interleaving field to obtain the violation score field. Then, the violation score field is gating judged according to the gate token field and the preset threshold packet to generate a violation flag and violation level field. When the gate token is a pass token, the violation level is obtained by segmenting according to the threshold packet. When the gate token is a token to be corrected or needs to be propagated and updated, the violation flag is set to pending confirmation and written to the pending confirmation flag field. The output is a set of violation records. S5-3. The input for this step is a set of violation records. According to the preset aggregation rules, the locations with violation marks are connected and aggregated on the cloth coordinate grid to form violation regions and isolated regions with an area smaller than the preset minimum area threshold are removed. For each violation region, the violation level field and the violation score field are summarized at the region level according to the preset summarization rules to generate a violation degree characterization. The violation degree characterization includes at least the maximum violation level, the average violation score and the region area. The set of violation locations and their violation degree characterization are output and written to the result cache for use in step S6. Through the above embodiments, step S5 can complete the positional consistency verification of the standardized fabric representation and the organizational feasibility constraint representation under a fixed field caliber, and stably output the set of violation locations and their degree of violation under the constraints of gating tokens and threshold packages, thereby reducing false alarms caused by single-point noise and providing reproducible input for subsequent defect classification and grade output; in practical applications: after the standardized fabric representation and organizational feasibility constraint representation of a certain batch of fabric have been generated, the allowed interweaving field, prohibited interweaving field, tolerance field and gating token field are read position by position according to the fabric coordinates, and the warp phase field, weft phase field and local texture response field are extracted to form a verification record. Then, the consistency verifier calculates the violation score and generates the violation grade according to the threshold package, and marks the positions that have not passed the gating as pending confirmation. Finally, the violation locations that have passed the gating are connected, aggregated and summarized to obtain the maximum violation grade and average violation score and area of the region as the degree of violation characterization and output for subsequent steps to generate defect detection results; S6. Generate defect detection results based on the set of violation locations and their degree of violation, and output the location information and category or grade information of the defects; This embodiment provides an implementable defect result generation process for step S6. Its purpose is to convert the set of violation locations and their degree of violation output in step S5 into on-site usable defect detection results, and to output defect location information and defect category or level information related to the fabric structure under a unified fabric coordinate system. This process takes the violation area as the object, first mapping the violation feature fields and constraint fields to candidate defect categories and levels based on the defect spectrum mapping table, then performing consistency fusion within a time window and filtering unstable candidates through false alarm suppression gating conditions, and finally solidifying the output fields and writing them to the result cache. This implementation process includes the following steps: S6-1. The input for this step is the set of violation locations and their violation severity characteristics. For each violation area, read the fabric coordinate boundary field, maximum violation level field, average violation score field, and area field. Also read the pattern unit number field, allowed interlacing field, prohibited interlacing field, and tolerance field from the corresponding organization feasibility constraint representation to form a set of violation feature fields. Perform a joint mapping operation according to the preset defect spectrum mapping table to generate candidate defect category field and candidate defect level field. The candidate defect category field is retrieved by the combination key of the pattern unit number field and the violation feature field, and the candidate defect level field is converted from the maximum violation level field and the average violation score field according to the preset level rules. Output a set of candidate defect records. S6-2. The input for this step is a set of candidate defect records. Within a preset time window, consistency fusion is performed on candidate defect records in the same fabric coordinate region to update the candidate defect level field and calculate the stability score field. Consistency fusion merges candidate records where the fabric coordinate boundary overlap exceeds a preset overlap threshold and updates the level by weighting the occurrence frequency and violation score. The stability score field is calculated from the number of consecutive frames of the candidate category, the level fluctuation amplitude, and the continuous passage of the gating token field. When the false alarm suppression gating condition is met, a suppression flag is written to filter candidate records. The false alarm suppression gating condition includes at least a stability score lower than a preset stability threshold or candidate categories alternating between adjacent pattern units without continuity. The output is a set of defect records after fusion and gating. S6-3. The input for this step is the set of defect records after fusion and gating. The defect detection results are generated from the retained defect records and written to the defect detection result cache. The defect location information is determined by the fabric coordinate boundary field and can be optionally converted to the original image pixel coordinates for display. The defect category or level information is determined by the candidate defect category field and the updated candidate defect level field. The output is the defect detection result. Through the above embodiments, step S6 can transform the violation area into an interpretable defect category and level under the organizational constraint semantics, and filter unstable candidates through temporal consistency fusion and false alarm suppression gating conditions, thereby reducing the false output caused by normal pattern mutations and improving the stability and reproducibility of the results under frequent pattern changes. In practical applications: when multiple violation areas are obtained in a batch of fabric, the candidate defect categories are first mapped in the defect spectrum mapping table by combining the pattern unit number field and the allowed interlacing and prohibited interlacing fields, and the candidate level is calculated according to the degree of violation. Then, the candidate records of the same area are merged and the stability score is calculated in a consecutive time window of several frames, and the candidate with low stability or alternating jump is written with suppression mark filtering. Finally, the defect detection results containing the fabric coordinate position and defect category and level are output for on-site rejection and re-inspection.
[0023] Furthermore, it also includes: a high-precision textile fabric defect detection system based on AI vision, comprising a priori acquisition module, a phase calculation module, a coordinate normalization module, a constraint generation module, a consistency verification module, and a result output module. The prior acquisition module is used to acquire the pattern design data and fabric structure data corresponding to the current production batch, and to acquire the target fabric surface image sequence continuously acquired by the industrial camera on the production line. The pattern design data and fabric structure data are used as the design prior input, and the fabric surface image sequence is used as the input to be detected. The phase calculation module calculates the warp and weft texture phase features of the target fabric based on the fabric image sequence and outputs the fabric coordinate feature field, which is used to characterize the local positional relationship of the fabric in the warp and weft directions. The coordinate normalization module performs coordinate alignment and resampling on the fabric image sequence based on the fabric coordinate feature field, and outputs a standardized fabric representation consistent with the fabric coordinates to eliminate the influence of geometric deformation caused by tension changes and weft skew. The constraint generation module generates a feasibility constraint representation of the fabric structure under the same fabric coordinates as the pattern design data and the fabric structure data, and outputs a feasibility judgment benchmark to limit the allowable range of fabric changes. The consistency verification module is used to verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. The output module generates defect detection results based on the set of violation locations and their degree of violation, outputting the location information and category or grade information of the defects.
[0024] Working principle: First, the pattern files and organization rules of the production batch are parsed into design priors. Then, continuous images captured by the production line camera are organized into a fabric image sequence. Subsequently, the texture phase in the warp and weft directions is calculated from the image sequence to obtain the fabric coordinate feature field. This field is used to align and resample each frame to a unified fabric coordinate system, generating a standardized fabric representation. This eliminates geometric deformation caused by tension fluctuations and weft skew at the source. Under the unified coordinate system, the design priors are transformed into organizational feasibility constraints and judgment benchmarks that can be called at each position. Finally, the standardized fabric representation and constraints are verified for consistency at each position to obtain the violation location and degree. The violation area is then mapped and output as the location, category, or level of the defect. The causal chain is to first establish stable coordinates using phase, then eliminate deformation using coordinates. Only after the deformation is eliminated can the constraints accurately fall on each position. Only after the constraints are stabilized can normal pattern variations be separated from real structural defects. In situations where jacquard fabrics undergo frequent style changes, there are few defect samples for new styles. Traditional models easily misinterpret normal pattern mutations as defects or miss broken warp or missing needles. This solution first reads the pattern and weave rules of the batch to obtain the position of each pattern unit on the fabric surface and the allowable interlacing range. After camera acquisition, the phase is calculated to assign coordinates to the fabric surface. Then, consecutive frames are aligned to the same fabric coordinates and uniformly resampled to ensure that the same coordinate corresponds to the same piece of fabric. Subsequently, the observation is checked point by point according to these coordinates to see if it falls within the allowable range. If a certain area consistently violates the rules in consecutive frames and to a high degree, the corresponding defect category and level are output, along with the location coordinates for re-inspection or rejection. If it is only a temporary deviation caused by a normal pattern mutation, it is suppressed during gating and temporal fusion and does not enter the final output, thus maintaining stable detection even under style changes and fluctuating working conditions.
[0025] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A high-precision detection method for textile fabric defects based on AI vision, characterized in that, include: S1. Obtain the pattern design data and fabric structure data corresponding to the current production batch, and obtain the target fabric surface image sequence continuously collected by the industrial camera on the production line. The pattern design data and fabric structure data are used as design prior inputs, and the fabric surface image sequence is used as the input to be detected. S2. Calculate the warp and weft texture phase features of the target fabric based on the fabric image sequence, and output the fabric coordinate feature field to characterize the local positional relationship of the fabric in the warp and weft directions. S3. Based on the fabric coordinate feature field, the fabric image sequence is aligned and resampled to output a standardized fabric representation consistent with the fabric coordinates, so as to eliminate the influence of geometric deformation caused by tension changes and weft skew. S4. Generate and standardize the fabric surface representation based on pattern design data and fabric structure data to represent the fabric feasibility constraint representation under the same fabric coordinates, and output the feasibility judgment benchmark used to limit the allowable range of fabric variation; S5. Verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. S6. Generate defect detection results based on the set of violation locations and their degree of violation, and output the location information and category or grade information of the defects.
2. The high-precision detection method for textile fabric defects based on AI vision according to claim 1, characterized in that: S1 includes: S1-1. Input is the pattern file source data of the current production batch. The pattern file source data is parsed according to the preset field rules to extract the pattern unit number set and its arrangement relationship in the warp and weft directions, and the pattern design data is output. S1-2. The input is the pattern design data. The pattern unit number set is calculated by looking up the table unit by unit according to the preset organization rule table to determine the warp and weft interlacing parameter set corresponding to each pattern unit. The output is the organization structure data, where the organization rule table gives the mapping relationship between the pattern unit number and the warp and weft interlacing parameter set. S1-3. The input is the raw image stream and pattern design data continuously acquired by the industrial camera on the production line. Continuous frames are extracted from the raw image stream according to the preset cropping rules and associated with the pattern unit number set according to the preset sorting rules to form a fabric image sequence. The output is the fabric image sequence to be detected.
3. The high-precision detection method for textile fabric defects based on AI vision according to claim 2, characterized in that: S2 includes: S2-1. The input is a sequence of fabric images. Each frame of the fabric image is divided into blocks according to a preset window size. For each image block, the principal period estimation operation is performed in the warp and weft directions to obtain the warp principal period and the weft principal period. The output is the warp principal period diagram and the weft principal period diagram corresponding to each image block. S2-2. The input is the warp principal periodic image and the weft principal periodic image. For each image block, perform phase accumulation operation along the corresponding direction to generate the warp phase value and the weft phase value. Then, stitch the warp phase value and the weft phase value according to their position in the fabric image to output the warp texture phase field and the weft texture phase field. S2-3. The input is the warp texture phase field and the weft texture phase field. The warp texture phase field and the weft texture phase field are subjected to consistency constraint smoothing to suppress local noise and maintain phase continuity. The output is the cloth coordinate feature field, which is composed of the warp texture phase field and the weft texture phase field.
4. The high-precision detection method for textile fabric defects based on AI vision according to claim 3, characterized in that: S3 includes: S3-1. The input is a sequence of fabric images and a fabric coordinate feature field. The inter-frame displacement field is calculated based on the warp and weft phase differences of the fabric coordinate feature field between adjacent frames. The output is the inter-frame displacement field corresponding to each adjacent frame pair. S3-2. The input is the inter-frame displacement field. The inter-frame displacement field is subjected to anomaly removal according to the preset confidence rules to remove phase jump points and interpolation is performed to complete the missing regions. The output is the inter-frame displacement field after anomaly removal and completion. S3-3. The input is the inter-frame displacement field after anomaly removal and completion. The inter-frame displacement field is processed by displacement accumulation operation in time order to generate the cumulative displacement field of each frame relative to the reference frame. The output is the cumulative displacement field sequence.
5. The high-precision detection method for textile fabric defects based on AI vision according to claim 4, characterized in that: S3 also includes: S3-4. The input is the cumulative displacement field sequence and the fabric image sequence. Based on the cumulative displacement field sequence, the coordinate transformation is performed on each frame of the fabric image to map each frame to the fabric coordinate system of the reference frame. The output is the aligned fabric image sequence. S3-5. The input is an aligned fabric image sequence. The aligned fabric image sequence is resampled on a preset fabric coordinate grid to ensure that each frame has a consistent fabric coordinate resolution. The output is a standardized fabric representation consistent with the fabric coordinates.
6. The high-precision detection method for textile fabric defects based on AI vision according to claim 5, characterized in that: S4 includes: S4-1. The input is pattern design data and weave structure data. According to the preset parsing rules, the pattern design data is decomposed into a set of pattern units with fabric coordinate index and the weave structure data is decomposed into a set of interlacing parameters with pattern unit number index. The output is a set of constraint atoms from pattern units to interlacing parameters. S4-2. The input is a set of constrained atoms and a normalized fabric representation. The warp and weft phase fields on the fabric coordinate grid are extracted from the normalized fabric representation as alignment evidence. The alignment evidence is written into the alignment evidence table to generate the first gating token. The output is an evidence package containing the first gating token. S4-3. The input is the evidence package and the set of constraint atoms. The consistency checker is called to perform organizational feasibility consistency check on each fabric coordinate position and generate a feasibility score field and an uncertainty field. The feasibility score field and uncertainty field are written into the feasibility score graph to form a second gating token. The output is a score package containing the second gating token.
7. The high-precision detection method for textile fabric defects based on AI vision according to claim 6, characterized in that: S4 also includes: S4-4. The input is a scoring package. Within the preset time series window, the feasibility scoring field is propagated and the uncertainty field is updated with confidence decay to obtain the updated scoring field and the updated uncertainty field. The updated scoring field and the updated uncertainty field are written into the time series scoring cache and a state lock is generated. The output is a time series scoring package with a state lock. S4-5. The input is a time-series scoring package with state lock and a standardized fabric representation. According to the preset conflict resolution rules, the updated scoring fields of the same fabric coordinate position across frames are branched and merged to form the final feasibility scoring field. When the rollback trigger condition is met, a rollback flag is written and a re-examination action is triggered to update the alignment evidence table. The output is the organization feasibility constraint representation and feasibility judgment benchmark. S4-6. The input is the organizational feasibility constraint representation and the feasibility judgment benchmark. The constraint fields and gate token fields used to limit the scope of allowed organizational changes in the organizational feasibility constraint representation are written into the constraint set storage area for use in step S5. The output is the callable feasibility judgment benchmark.
8. The high-precision detection method for textile fabric defects based on AI vision according to claim 7, characterized in that: S5 includes: S5-1. The input is a standardized fabric representation and a fabric feasibility constraint representation. The constraint field and gate token field in the fabric feasibility constraint representation are read according to the fabric coordinate position. The observation field corresponding to the fabric coordinate position is extracted from the standardized fabric representation to form a position-level verification record. The output is a set of position-level verification records. S5-2. The input is a set of location-level verification records. The consistency checker is called to perform constraint satisfaction calculation on each location-level verification record to obtain the violation score field. Based on the gate token field and the preset threshold packet, the violation score field is gating to generate the violation flag and violation level fields. The output is a set of violation records containing the violation flag and violation level fields. S5-3. The input is a set of violation records. According to the preset aggregation rules, the locations with violation marks are connected and aggregated, and the violation level field is summarized at the regional level to generate a set of violation locations and a representation of the degree of violation. The set of violation locations and the representation of the degree of violation are written into the result cache for use in step S6. The set of violation locations and the representation of the degree of violation are output.
9. The high-precision detection method for textile fabric defects based on AI vision according to claim 8, characterized in that: S6 includes: S6-1. The input is a set of violation locations and their degree of violation. According to the preset defect spectrum mapping table, the violation feature field of each violation location is jointly mapped with the constraint field in the organization feasibility constraint representation to generate candidate defect category field and candidate defect level field. The output is a set of candidate defect records. S6-2. The input is a set of candidate defect records. Within the preset time window, the candidate defect records in the same fabric coordinate area are subjected to consistency fusion to update the candidate defect level field and calculate the stability score field. When the false alarm suppression gating condition is met, a suppression flag is written to filter the candidate defect records caused by normal mutation of the pattern. The output is the set of defect records after fusion and gating. S6-3. The input is the set of defect records after fusion and gating. The location information and category or level information of the defect are generated for the retained defect records and written into the defect detection result cache. The output is the defect detection result.
10. A high-precision defect detection system for textile fabrics based on AI vision, comprising a priori acquisition module, a phase calculation module, a coordinate normalization module, a constraint generation module, a consistency verification module, and a result output module, characterized in that: The prior acquisition module is used to acquire the pattern design data and fabric structure data corresponding to the current production batch, and to acquire the target fabric surface image sequence continuously acquired by the industrial camera on the production line. The pattern design data and fabric structure data are used as the design prior input, and the fabric surface image sequence is used as the input to be detected. The phase calculation module calculates the warp and weft texture phase features of the target fabric based on the fabric image sequence and outputs the fabric coordinate feature field, which is used to characterize the local positional relationship of the fabric in the warp and weft directions. The coordinate normalization module performs coordinate alignment and resampling on the fabric image sequence based on the fabric coordinate feature field, and outputs a standardized fabric representation consistent with the fabric coordinates to eliminate the influence of geometric deformation caused by tension changes and weft skew. The constraint generation module generates a feasibility constraint representation of the fabric structure under the same fabric coordinates as the pattern design data and the fabric structure data, and outputs a feasibility judgment benchmark to limit the allowable range of fabric changes. The consistency verification module is used to verify the consistency between the standardized fabric representation and the organizational feasibility constraint representation, calculate whether the coordinate position of each fabric violates the feasibility judgment benchmark, and output the set of violation positions and their degree of violation. The output module generates defect detection results based on the set of violation locations and their degree of violation, outputting the location information and category or grade information of the defects.