An artificial intelligence-based rapid foreign fiber identification method and system

By acquiring yarn parameter features, matching neurons using a preset rule base and freezing non-critical neurons, and combining with the improved YOLOv8-nano model, the problems of low efficiency and poor accuracy in traditional yarn foreign fiber detection are solved, achieving efficient and accurate yarn foreign fiber identification.

CN120892972BActive Publication Date: 2025-12-05DONGHUA UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511417992.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-05
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Traditional methods for detecting foreign fibers in yarn rely on manual labor or simple machine vision, which are inefficient and have poor accuracy. Furthermore, existing CNN-based methods lack generalization ability when faced with different yarn parameters, making it difficult to meet the real-time and diverse detection needs of industrial production lines.

Method used

By acquiring yarn parameter features, matching the corresponding first number of neurons using a preset rule base, and freezing non-first number of neurons during inference, combined with the improved YOLOv8-nano model, yarn texture feature learning is enhanced, and the neuron freezing strategy is dynamically adjusted to improve detection accuracy and efficiency.

Benefits of technology

It improves the accuracy of yarn foreign fiber detection, reduces model computation, meets the real-time detection needs of industrial production lines, adapts to different yarn parameters and new yarn scenarios, and enhances the detection effect in the textile industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892972B_ABST
    Figure CN120892972B_ABST
Patent Text Reader

Abstract

The application belongs to the field of production control, and specifically discloses a rapid foreign fiber identification method and system based on artificial intelligence. The method comprises the following steps: acquiring parameters such as raw materials, process types, twist and thickness of yarn to be detected, and extracting features thereof; performing parameter combination matching on the parameters in a preset rule base to obtain a first number of neurons; inputting the parameter features into a pre-trained foreign fiber identification model, freezing neurons other than the first number of neurons during reasoning, and only using the first number of neurons for forward reasoning to output a foreign fiber identification result. The method dynamically freezes neurons, accurately selects neurons participating in reasoning according to yarn parameter features, improves the foreign fiber detection accuracy, greatly improves the operation efficiency, effectively solves the problems of low detection efficiency and insufficient accuracy of traditional methods in processing different yarn parameters, and is suitable for yarn foreign fiber rapid detection scenes in industrial production.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of production control, and particularly relates to a rapid foreign fiber identification method and system based on artificial intelligence. BACKGROUND

[0002] In the production of the textile industry, the existence of foreign fibers (such as polyester foreign fibers, hair foreign fibers, metal wire foreign fibers, etc.) in yarns can seriously affect the quality of textiles, and therefore, yarn foreign fiber detection is a key link in production control. Traditional foreign fiber detection relies on manual visual inspection or simple machine vision technology, and manual detection is low in efficiency and strong in subjectivity, and is prone to missed detection due to fatigue. Simple machine vision technology is difficult to distinguish between normal texture differences of yarns and foreign fiber characteristics, and the detection accuracy is significantly affected by yarn parameters (raw materials, processes, twist, thickness), such as the natural curl of cotton fibers and the smooth surface of chemical fibers, the tight texture of high-twist yarns and the loose structure of low-twist yarns, which are easily misjudged as foreign fibers or cause real foreign fibers to be hidden.

[0003] Existing foreign fiber detection methods based on general CNN models can improve accuracy to a certain extent, but do not optimize the model inference process in combination with differences in yarn parameters, and have problems of low operation efficiency, poor real-time performance, and low accuracy, which are difficult to adapt to the detection speed requirements of industrial production lines. At the same time, the generalization ability of the model for different parameter yarns is insufficient, and when faced with new raw materials or processes, the detection accuracy is easily reduced due to insufficient feature learning, and it is difficult to meet the detection needs of diversified yarn production scenarios. SUMMARY

[0004] To this end, the present application provides a rapid foreign fiber identification method and system based on artificial intelligence to solve the above technical problems.

[0005] The present application provides a rapid foreign fiber identification method based on artificial intelligence, comprising the following method steps: obtaining yarn parameters of yarns to be detected, and extracting corresponding yarn parameter features, the yarn parameters at least including yarn raw materials, process types, twist, and thickness; based on the yarn parameter features, matching parameter combinations in a preset rule library, and obtaining a first number of neurons corresponding to the yarn parameters based on the matching results; inputting the yarn parameter features into a pre-trained foreign fiber identification model, in the inference process of the foreign fiber identification model, freezing non-first number of neurons, only using the first number of neurons for forward inference, and outputting a foreign fiber identification result.

[0006] Further, the preset rule library includes a main index table, the main index table adopts a hash table structure, the key value stores a hash value of the yarn parameter feature, and the value domain stores a neuron configuration of the corresponding yarn parameter, including the first number, a neuron ID list, and an activation threshold.

[0007] Further, the matching the parameter combination in the preset rule library comprises: when the hash value of the input parameter feature is completely consistent with the key value in the main index table, the corresponding neuron configuration is directly called; otherwise, the cosine similarity of the input parameter combination feature vector and the parameter combination feature vector corresponding to all key values in the main index table is calculated, the key values with a similarity greater than a first preset threshold are screened, the optimal matching key value is obtained based on the influence degree of the parameter on the foreign fiber detection, and the neuron configuration corresponding to the optimal matching key value is called.

[0008] Further, the first number of neurons are screened from the set of key neurons, wherein the key neurons are obtained by the following steps: grouping the pre-training data set according to the yarn parameters to form multiple groups of samples; inputting each group of samples into the pre-training foreign fiber identification model to extract neuron activation values, wherein the activation values greater than a first preset threshold are effective activations; for each neuron i, the effective activation frequency f_ij in the parameter group j is calculated; the effective activation frequency f_ij is compared with a second preset threshold, and if the effective activation frequency f_ij is greater than or equal to the second preset threshold, the corresponding neuron is the key neuron of the parameter group.

[0009] Further, if there is no key value with a similarity greater than the first preset threshold, the neurons with the top K effective activation frequencies are selected, wherein K>1.

[0010] Further, the linear correlation degree between the parameters is obtained by calculating the Pearson correlation coefficient, and the second preset threshold is dynamically adjusted based on the Pearson correlation coefficient, wherein the greater the Pearson correlation coefficient, the higher the second preset threshold.

[0011] Further, the first number of neurons are screened from the set of key neurons, comprising: based on the influence degree of the parameter on the foreign fiber detection accuracy, the key neuron subsets matched with each parameter are respectively screened from the set of key neurons according to the influence degree, and the first number of neurons are obtained by taking the intersection of each neuron subset.

[0012] Further, after taking the intersection of each neuron subset, the neurons in the intersection are verified, comprising: the neurons in the intersection are inferred based on the foreign fiber identification model to test the foreign fiber detection mAP under the yarn parameter; if the mAP decreases by more than a preset threshold compared with the full neuron inference, the top K neurons with the highest activation frequencies are supplemented from the general key neurons until the mAP loss is less than the preset threshold, wherein K>1.

[0013] Further, the intersection of each subset of neurons is taken, and the neurons in the intersection are verified, including calculating the improvement in operation efficiency based on the proportion of the number of neurons in the intersection to the total number of neurons, and if the improvement in operation efficiency is less than a preset threshold, the first m neurons with the lowest activation frequency are removed, where m>1.

[0014] In another aspect, the application also provides a fast foreign fiber identification system based on artificial intelligence, comprising: a parameter feature acquisition module, configured to acquire yarn parameters of a yarn to be detected and extract corresponding yarn parameter features, wherein the yarn parameters at least include yarn raw material, process type, twist and thickness; a neuron acquisition module, configured to match parameter combinations in a preset rule base based on the yarn parameter features, and acquire a first number of neurons corresponding to the yarn parameters based on the matching result; and a foreign fiber identification module, configured to input the yarn parameter features into a pre-trained foreign fiber identification model, wherein in the inference process, the foreign fiber identification model freezes non-first number of neurons, only uses the first number of neurons for forward inference, and outputs a foreign fiber identification result.

[0015] The application acquires the raw material, process type, twist and thickness parameters of the yarn to be detected and extracts features, matches and acquires a first number of neurons in a preset rule base, freezes non-first number of neurons during inference and only uses forward inference, which not only relies on yarn parameters to accurately select key neurons and avoid interference of redundant neurons, effectively improves foreign fiber detection accuracy, solves the misjudgment and missed detection problems caused by differences in yarn parameters in traditional methods, but also greatly reduces model operation amount, improves inference efficiency, meets real-time detection requirements of industrial production lines, and the rule base supports dynamic updating and flexible matching, has strong adaptability to different parameter yarns and new yarn scenarios, and can be stably applied to the foreign fiber detection link of the textile industry. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.

[0017] Other features, objects and advantages of the application will become more apparent through reading the following detailed description of the non-limiting embodiments with reference to the accompanying drawings.

[0018] Figure 1 A flowchart of a fast foreign fiber identification method based on artificial intelligence provided by the embodiments of the application.

[0019] Figure 2A schematic diagram of an improved YOLOv8-nano model architecture is provided for the embodiments of the present application.

[0020] Figure 3 A schematic diagram of a rule calculation process is provided for the embodiments of the present application.

[0021] Figure 4 A schematic diagram of a rapid foreign fiber identification system based on artificial intelligence is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0023] As shown in Figure 1 The embodiments of the present application disclose a rapid foreign fiber identification method based on artificial intelligence 100, comprising the following method steps: S101, acquiring yarn parameters of yarn to be detected, and extracting corresponding yarn parameter features, wherein the yarn parameters at least include yarn raw material, process type, twist, and fineness.

[0024] S102, based on the yarn parameter features, matching parameter combinations in a preset rule library, and based on the matching result, acquiring a first number of neurons corresponding to the yarn parameters.

[0025] S103, inputting the yarn parameter features into a pre-trained foreign fiber identification model, wherein in the inference process of the foreign fiber identification model, non-first number of neurons are frozen, only the first number of neurons are used for forward inference, and a foreign fiber identification result is output.

[0026] In some embodiments, a general basic model covering multiple types of yarn and multiple scene foreign fibers is first trained, wherein the core of foreign fiber detection is to let the model learn the difference between normal yarn texture and foreign fibers such as polypropylene silk, hair, and colored fibers, and the raw material (cotton, hemp, wool, chemical fiber) of the yarn, the process (ring spinning, air spinning), the twist (high twist / low twist), and the fineness (count, such as 21S, 40S) will directly affect the normal texture features, for example, the natural curl of cotton fiber and the smooth surface of chemical fiber, the tight texture of high twist yarn and the loose structure of low twist yarn, all of which need to be reflected in the data set, otherwise the model is easy to misjudge the normal texture difference as foreign fibers.

[0027] In this embodiment, the training data acquisition, exemplarily, includes: at least 5 types of raw materials (cotton, polyester, acrylic, linen, wool), 3 types of processes, 4 or more twist levels (e.g., 300T / m, 500T / m, 800T / m, 1200T / m), and 5 or more yarn counts (e.g., 16S, 21S, 32S, 40S, 60S); the foreign fibers cover 8-10 types of foreign fibers commonly used in textile production (e.g., polyester foreign fibers, wool foreign fibers, colored yarn foreign fibers, metal wire foreign fibers, etc.), with ≥500 samples of each type of foreign fiber under different yarn parameters; uniform resolution (e.g., 512×512 pixels), acquired using an industrial camera and backlight source to ensure consistent texture clarity (avoiding the impact of lighting differences on feature learning).

[0028] Optionally, for the linear characteristics of the yarn, horizontal translation, slight rotation (±5°), and scaling (0.8-1.2 times) are used to enhance the model's adaptability to the yarn position / angle; for the randomness of foreign fibers, random occlusion (simulating local foreign fibers) and brightness adjustment (±15%) are used to simulate the lighting fluctuations in the industrial environment, thereby improving the robustness of the model.

[0029] In this embodiment, a CNN architecture that performs well in small target detection (foreign fibers typically occupy less than 5% of the image area) is selected, such as a combination of feature pyramids and attention mechanisms, to ensure that the model can capture the subtle features of foreign fibers, while facilitating subsequent analysis of the relationship between neurons and yarn parameters.

[0030] Specifically, an improved YOLOv8-nano (lightweight) or Faster R-CNN (high precision, suitable for complex heterogeneous fiber scenarios) is used, for example, such as Figure 2 As shown, the improved YOLOv8-nano model architecture includes a backbone network, a neck, and a head. The main improvements include: adding a yarn texture attention module to the neck to enhance the model's learning of normal features such as yarn fiber direction and density through channel attention (such as the SE module), reducing attention to background noise; and adding a foreign fiber category branch to the head to output the foreign fiber category (such as hair or synthetic fiber) in addition to detecting the location of foreign fibers (bounding boxes), providing more fine-grained features for subsequent parameter matching.

[0031] Specifically, the core feature of yarn images is the regular texture of normal fibers (such as the natural twisting of cotton fibers and the parallel arrangement of synthetic fibers), while foreign fibers such as hair and colored fibers essentially disrupt this regularity. However, industrially acquired images often contain background noise such as uneven lighting and conveyor belt textures. Traditional CNNs may mistakenly treat noise as foreign fiber features or ignore subtle anomalies in yarn texture, such as local fiber arrangement disorder.

[0032] In this embodiment, the SE module principle gives dynamic weights to the feature channels output by the convolutional layer through the squeeze and excitation operations, gives high weights to key feature channels such as channels containing yarn texture, and gives low weights to channels dominated by noise.

[0033] Exemplarily, for the squeeze operation, for example, global average pooling is performed on the feature map output by the convolutional layer to obtain global information of each channel, such as the average value of a certain channel being high, which may correspond to a yarn texture dense area; for the excitation operation, for example, the dependence relationship between channels is learned through a fully connected layer, and higher weights are assigned to key feature channels such as yarn fiber direction and density distribution (such as channels capturing transverse texture and channels reflecting fiber density); finally, the feature is re-calibrated by multiplying the learned weights with the original feature channel, to strengthen the expression of yarn texture features and weaken the interference of background noise.

[0034] The head of the traditional target detection model usually only outputs the target position (bounding box) and whether it is a foreign fiber (binary classification), but different types of foreign fibers, such as hair, chemical fiber, and metal wire, have significant differences in relevance to yarn parameters (raw materials, process, etc.). For example, hair foreign fibers are more common in cotton spinning, and metal wire foreign fibers need to be detected in chemical fiber spinning. It is difficult to provide fine-grained feature basis for subsequent dynamic frozen neurons by only identifying whether it is a foreign fiber.

[0035] In this embodiment, on the basis of the original bounding box regression branch and the foreign fiber / non-foreign fiber classification branch of the detection head, a foreign fiber category branch is newly added. Exemplarily, feature sharing: the advanced features (containing comprehensive information of yarn texture and foreign fibers) output by the neck are reused; category classification: through 2-3 layers of fully connected layers or convolutional layers, the features are mapped to the preset foreign fiber categories (such as 8 categories), and the probability of each category is output (such as hair foreign fiber: 0.92, chemical fiber foreign fiber: 0.05); loss function: on the basis of the original loss bounding box loss and binary classification loss, the category cross-entropy loss is added, so that the model simultaneously learns three tasks of positioning foreign fibers, judging whether it is a foreign fiber, and identifying the type of foreign fiber.

[0036] Thus, the yarn texture attention module of the neck provides high-quality features after denoising for the head, ensuring that the head can more accurately locate the foreign fibers and identify the category; and the foreign fiber category branch of the head converts the features into semantic information that can be used for rule matching, so that the screening of the dynamic frozen neurons is more in line with the association rules of specific foreign fiber types and yarn parameters.

[0037] In some embodiments, optionally, the model training is divided into two stages, the first stage (1-100 rounds), the learning rate is 0.001, and all neurons participate in training; the second stage (101-200 rounds), the learning rate is reduced to 0.0001, the model parameters are fine-tuned, and the detection accuracy under multiple yarn parameters is ensured to be stable, for example, the target is to achieve an average precision mean mAP@0.5≥92% and an inference speed≥30fps.

[0038] After training is completed, the complete model weight (including all neuron parameters) and the feature layer activation record (recording the activation frequency of each layer of neurons under different yarn parameter samples, providing data support for subsequent screening) are saved.

[0039] In the embodiments, a mapping relationship between the yarn parameters (raw materials, process, twist, thickness) and the model neuron activation is established to determine which neurons are more critical for the detection of foreign fibers of specific yarn parameters, and to avoid blind freezing leading to feature loss.

[0040] Specifically, part of the yarn parameters (such as raw materials, process) are qualitatively described, which are first converted into quantifiable features recognizable by the model, and then the relevance to the detection of foreign fibers is analyzed.

[0041] For example, the yarn parameter feature extraction is shown in the following table: Table 1:

[0042]

[0043] In the embodiments, there is a correlation between the yarn parameters, such as higher count usually means higher twist, and chemical fiber raw materials usually use air-jet spinning. In this embodiment, the linear correlation degree between parameters is calculated by Pearson correlation coefficient to avoid neuron screening deviation caused by repeated use of redundant parameters.

[0044] Specifically, 1000 samples are randomly extracted from the pre-training data set, each sample contains quantized values of 4 parameters (5 dimensions of raw materials, 3 dimensions of process, 1 dimension of twist, and 1 dimension of thickness, a total of 10 dimensions); a 10x10 correlation coefficient matrix is constructed, and the Pearson coefficient r (value range [-1, 1]) of any two parameter dimensions is calculated; a threshold (such as |r|≥0.7) is set to determine strong correlation parameters: for example, if the r of a certain dimension of chemical fiber raw material and air-jet spinning process is 0.85, it means that the two are strongly correlated, and the neurons related to the chemical fiber raw material can be preferentially retained during subsequent neuron screening, reducing the repeated dependence on the air-jet spinning process parameters.

[0045] In this embodiment, based on the feature layer activation record saved in the pre-training stage, the response sensitivity of each neuron to different yarn parameters is analyzed, that is, when a yarn image of a certain parameter is input, which neurons have activation values (output probability) significantly higher than other neurons, these neurons are the key neurons for the detection of foreign fibers under this parameter.

[0046] Specifically, the pre-training data set is divided into N small groups (such as 5 raw materials x 3 processes x 4 twist x 5 count = 300 groups) according to yarn parameters; the activation value is counted, for each group of samples, input the pre-training model, extract the neuron activation value (activation value > 0.5 is considered to be effective activation) of the convolution layer (such as Conv5) and the fully connected layer (such as FC2); the correlation degree is calculated, for each neuron i, the effective activation frequency f_ij in the parameter group j is calculated (i.e. the number of samples in which the neuron i is activated in the group / the total number of samples in the group); set the frequency threshold (such as f_ij ≥ 0.8), if the activation frequency of neuron i in parameter group j is ≥ 0.8 and the activation frequency in other parameter groups is ≤ 0.3, then neuron i is determined as the exclusive key neuron of parameter group j; if the activation frequency of neuron i in multiple similar parameter groups (such as “cotton raw material, ring spinning” and “cotton raw material, air spinning”) is all ≥ 0.7, then it is determined as a cotton raw material general key neuron.

[0047] In this embodiment, a mapping rule library is established to input yarn parameters and output a first number of neurons (key neurons that need to be activated), which can quickly locate key neurons and freeze redundant neurons during reasoning. Optionally, the rule library takes into account accuracy priority and efficiency priority to avoid excessive freezing or insufficient freezing.

[0048] Specifically, the rule library uses a hierarchical matching structure, first matches the core parameters (the parameters that have the greatest impact on alien fiber detection), and then matches the secondary parameters, gradually narrowing down the range of key neurons. Among them, the priority of the core parameters is determined based on the influence degree of the parameter- alien fiber detection accuracy, and exemplarily, the change rate of alien fiber detection mAP can be observed by fixing other parameters and only changing a certain parameter through the control variable method, the higher the change rate, the higher the priority.

[0049] As an example, the priority ranking is raw material (influence degree 40%) > count (25%) > process (20%) > twist (15%), because the raw material directly determines the fiber texture characteristics, and has the highest degree of alien fiber differentiation; the count is second, because the thickness affects the texture density.

[0050] In this embodiment, the first number is not a fixed value, but is filtered from the key neuron set according to the parameter combination of the current yarn to be detected, and optionally, the constraint conditions of accuracy loss ≤ 2% and / or operation efficiency improvement ≥ 30% are met at the same time. Exemplarily, as shown in Figure 3 The rule calculation process is as follows: S301, core parameter matching, according to the raw material (such as “cotton”) and the count (such as “40S”) of the yarn to be detected, extract the exclusive key neurons of “cotton raw material, 40S count” (set as set A, number n1) from the correlation degree analysis result.

[0051] Extract the general key neurons of cotton raw material (set B, number n2) and 40S branch number general key neurons (set C, number n3), and remove the repeated neurons of sets A and B and C, to obtain the preliminary key set S1=A∪(B-A)∪(C-A), and the number n_s1=n1+(n2-repeated number)+(n3-repeated number).

[0052] S302, secondary parameter filtering, add the process (such as ring spinning) and twist (such as 500T / m) of the yarn to be detected, and extract the exclusive key neurons of "ring spinning, 500T / m" (set D, number n4).

[0053] Calculate the intersection of sets D and S1, if the activation frequency of the intersection neurons in S1 is ≥0.9, keep these neurons; if the intersection is empty, and the activation frequency of the neurons in set D in the "cotton, 40S" sample is ≥0.7, add D to S1 to obtain the updated set S2, and the number n_s2=n_s1+(n4-repeated number) (if any).

[0054] S303, constraint verification and adjustment, precision verification, use the neurons in S2 to infer (freeze other neurons) and test the mAP of the yarn parameter under the foreign fiber detection; if the mAP decreases by >2% compared with the whole neuron inference, supplement the top k neurons (k starts from 5 and increases) with the highest activation frequency from the general key neuron library (pre-trained neurons that contribute to all parameters) until the mAP loss is ≤2%.

[0055] Efficiency verification, calculate the proportion of the number of neurons in S2 to the number of whole neurons (such as 1000 whole neurons and 400 in S2, the proportion is 40%), if the operation efficiency improves (1-proportion)×100%<30%, remove the top m neurons (m starts from 10 and increases) with the lowest activation frequency in S2 without affecting the accuracy, until the efficiency improves ≥30%.

[0056] S304, final determination of the first number, after accuracy and efficiency verification, the number of neurons in S2 is the first number, and the corresponding neuron ID and activation threshold (such as activation value ≥0.5) are stored in the rule library and associated with the yarn parameter combination.

[0057] In this embodiment, the rule base uses a composite data structure to improve retrieval efficiency. For example, it can include a main index table (hash table) including key values and value ranges, where the key values can be standardized yarn parameter combinations (e.g., 5-dimensional raw material, 3-dimensional process, 1-dimensional twist, and 1-dimensional thickness, a total of 10-dimensional feature vector hash values). The value range is the neuron configuration information stored for the corresponding parameter combination, which specifically includes: the first number: the total number of neurons to be activated; neuron ID list: layer number and position index of key neurons in the model (e.g., "Conv5_32 neuron" and "FC2_105 neuron"); activation threshold: the determination value of the effective activation of the neuron (default 0.5); precision-efficiency coefficient: records the historical detection mAP and inference speed under this rule, which is used for subsequent iterative optimization.

[0058] Optionally, it can also include a parameter association matrix with dimensions of neuron number x yarn parameter dimension (e.g., 1000 x 10), which stores the activation sensitivity coefficient (range 0-1, obtained from the aforementioned association degree analysis) of each neuron to each parameter dimension, for quickly calculating the similarity of new parameter combinations with existing rules.

[0059] In some embodiments, when the hash value of the input parameter combination is completely consistent with the key value in the main index table, the corresponding neuron configuration is directly called, and the matching time is ≤1 ms (based on hash table O(1) complexity).

[0060] When there is no exact match for the input parameter combination, the approximate rule is located by the following steps: calculate the cosine similarity of the input parameter feature vector with all key values in the main index table, and select candidate rules with a similarity ≥0.8; for the candidate rules, calculate the comprehensive score according to the core parameter (raw material and count) similarity weight 0.6 and the secondary parameter (process and twist) similarity weight 0.4, and select the rule with the highest score as the approximate match; based on the neuron set of the approximate rule, adjust the number of neurons according to the difference of the input parameters (e.g., when the raw material similarity is 0.9, retain 90% of the key neurons of the rule).

[0061] Optionally, if the comprehensive score of all candidate rules is <0.6, or there is no candidate rule with a similarity ≥0.8; then trigger the general rule layer, activate the first 60% of the general key neuron library, and mark this parameter combination as to be learned and include it in the next round of rule base update.

[0062] Optionally, when the production line produces a new yarn parameter combination (such as a new chemical fiber raw material), the parameters and the corresponding neuron activation are automatically recorded. After 100 new samples are accumulated, the rule base incremental update is triggered: the similarity of the new parameters and the existing rules is calculated, and if the similarity < 0.7, a new index key-value pair is added; the neuron set corresponding to the strongly related parameters is de-duplicated and merged (for example, the correlation coefficient r between the new chemical fiber and the existing chemical fiber raw material is 0.8, and the key neuron set is merged, and the neurons with the top 80% activation frequencies are retained).

[0063] Thus, based on the improved CNN model, by freezing the redundant neurons corresponding to the current parameters during inference for different parameter features, not only the recognition speed of the model is improved, but also the interference of redundant neurons on inference is avoided, and the recognition accuracy is improved.

[0064] Figure 4 A rapid foreign fiber recognition system 400 based on artificial intelligence is shown. The device embodiment corresponds to the method embodiment shown in Figure 1 The device embodiment corresponds to the method embodiment shown in

[0065] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An artificial intelligence-based rapid foreign fiber identification method, characterized in that, The method comprises the following steps: obtaining yarn parameters of a yarn to be detected, and extracting corresponding yarn parameter features, wherein the yarn parameters at least include yarn raw materials, process types, twist and thickness; based on the yarn parameter features, matching parameter combinations in a preset rule library, and obtaining a first number of neurons corresponding to the yarn parameters based on a matching result; inputting the yarn parameter features into a pre-trained foreign fiber identification model, wherein in an inference process, non-first number of neurons are frozen, only the first number of neurons are used for forward inference, and a foreign fiber identification result is outputted; the first number of neurons are selected from a set of key neurons, wherein the key neurons are obtained by the following steps: grouping a pre-training data set according to yarn parameters to form multiple groups of samples; inputting each group of samples into a pre-trained foreign fiber identification model, and extracting neuron activation values, wherein an activation value greater than a first preset threshold is an effective activation; for each neuron i, the effective activation frequency f_ij in the parameter group j is calculated; comparing the effective activation frequency f_ij with a second preset threshold, if the effective activation frequency f_ij is greater than or equal to the second preset threshold, the corresponding neuron is the key neuron of the parameter group, wherein, if the effective activation frequency of neuron i in multiple parameter groups containing the same parameter is greater than the preset threshold, the neuron is a general key neuron corresponding to the parameter; the first number of neurons are selected from the set of key neurons, including, based on the influence degree of the parameters on the foreign fiber detection accuracy, the key neuron subsets matched with each parameter are respectively selected from the set of key neurons according to the influence degree, and the first number of neurons is obtained by taking the intersection of each neuron subset.

2. The method according to claim 1, wherein the preset rule library comprises a main index table, the main index table adopts a hash table structure, the hash value of the yarn parameter feature is stored as a key value, and the neuron configuration corresponding to the yarn parameter is stored as a value domain, including the first number, the neuron ID list and the activation threshold.

3. The method according to claim 2, wherein the matching parameter combination in the preset rule library comprises: when the hash value of the input parameter feature is completely consistent with the key value in the main index table, the corresponding neuron configuration is directly called; otherwise, the cosine similarity of the input parameter combination feature vector and the parameter combination feature vector corresponding to all key values in the main index table is calculated, the key values with a similarity greater than a first preset threshold are screened, the optimal matching key value is obtained by weighting based on the influence degree of the parameters on the foreign fiber detection, and the neuron configuration corresponding to the optimal matching key value is called.

4. The method according to claim 3, wherein if there is no key value with a similarity greater than the first preset threshold, the neurons with the top K effective activation frequencies are selected, wherein K>1.

5. The method according to claim 4, wherein ​ ​ The linear correlation degree between parameters is obtained by calculating a Pearson correlation coefficient, and the second preset threshold is dynamically adjusted based on the Pearson correlation coefficient, wherein the greater the Pearson correlation coefficient is, the higher the second preset threshold is.

6. The fast foreign fiber identification method based on artificial intelligence according to claim 1, wherein, After taking the intersection of each neuron subset, the neurons in the intersection are verified, including, based on the proportion of the number of neurons in the intersection to the total number of neurons, calculating the improvement of operation efficiency, if the operation efficiency improvement is less than the preset threshold, the first m neurons with the lowest activation frequency are removed, wherein m>1.

7. The fast foreign fiber identification method based on artificial intelligence according to claim 6, wherein, After taking the intersection of each neuron subset, the neurons in the intersection are verified, including, based on the proportion of the number of neurons in the intersection to the total number of neurons, calculating the improvement of operation efficiency, if the operation efficiency improvement is less than the preset threshold, the first m neurons with the lowest activation frequency are removed, wherein m>1.

8. An artificial intelligence-based rapid foreign fiber identification system, characterized in that: including, The parameter feature acquisition module is configured to acquire yarn parameters of a yarn to be detected and extract corresponding yarn parameter features, wherein the yarn parameters at least include yarn raw materials, process types, twist and thickness. The neuron acquisition module is configured to match parameter combinations in a preset rule library based on the yarn parameter features, and acquire a first number of neurons corresponding to the yarn parameters based on a matching result. The foreign fiber identification module is configured to input the yarn parameter features into a pre-trained foreign fiber identification model, wherein in an inference process of the foreign fiber identification model, non-first number of neurons are frozen, only the first number of neurons are used for forward inference, and a foreign fiber identification result is output. The first number of neurons are selected from a set of key neurons, wherein the key neurons are acquired by the following steps: The pre-training data set is grouped according to yarn parameters to form multiple groups of samples. Each group of samples is input into a pre-trained foreign fiber identification model to extract neuron activation values, wherein an activation value greater than a first preset threshold is an effective activation. For each neuron i, the effective activation frequency f_ij in the parameter group j is calculated. The effective activation frequency f_ij is compared with a second preset threshold, if the effective activation frequency f_ij is greater than or equal to the second preset threshold, the corresponding neuron is the key neuron for this group of parameters, wherein, if the effective activation frequency of neuron i in multiple parameter groups containing the same parameter is greater than the preset threshold, the neuron is a general key neuron corresponding to the parameter; The first number of neurons are selected from the set of key neurons, including, based on the influence degree of parameters on foreign fiber detection accuracy, sorting according to the influence degree, respectively selecting key neuron subsets matched with each parameter from the set of key neurons, and taking the intersection of each neuron subset to obtain the first number of neurons.

Citation Information

Patent Citations

  • Attention area marking method and device based on machine vision, equipment and medium

    CN118968025A

  • Foreign fiber identification method and device, equipment and storage medium

    CN119723538A