A colored yarn color difference intelligent detection method and system based on image analysis
By using an image analysis-based method, inversion gradient model and manifold learning technology to identify color difference shifts in colored silk, the problem of slow color difference shifts being difficult to detect by traditional detection methods is solved, and high-precision color difference detection and automated analysis are achieved.
Patent Information
- Application Number
- CN202511518439.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Traditional methods struggle to detect color shifts that occur slowly in a particular direction within colored silk, such as band drift or gradual drift of the silk threads, leading to color inconsistencies and a decline in visual quality.
An image analysis-based approach is employed, utilizing an inversion gradient model to identify spectral feature vectors, constructing a multidimensional color difference prediction model, and combining manifold learning techniques with directional gradient histogram clustering to identify the direction of color difference shift and generate a detection report.
It achieves high-precision automated recognition of minute color difference changes in colored silk images, improves the robustness and accuracy of color difference detection, and can effectively detect defects such as color difference bands and color gradient stripes.
Smart Images

Figure CN120976567B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method and system for intelligent detection of color difference in colored silk based on image analysis. Background Technology
[0002] Colored silk refers to fine filaments or textile fibers that have been dyed or have natural colors. They are commonly used in high-end textiles, silk, and industrial testing. Their image characteristics are usually manifested as color areas with directional textures and clear boundaries. Color difference detection refers to measuring and identifying the difference between the surface color of a sample and a standard color through optical imaging, image processing, or hyperspectral analysis. The purpose is to discover quality problems such as color inconsistency, deviation, and contamination.
[0003] When the color change of colored silk is not abrupt but a slow transition along a certain direction, such as stripe drift or change along the direction of the silk, traditional color difference detection methods based on fixed thresholds or static area comparisons are difficult to detect this continuous shift. As a result, many subtle and persistent color difference shifts (such as gradual color change in stripes, gradual drift of color difference bands and silk threads) are not detected in time during quality inspection, which in turn affects the color consistency and visual quality of the final product.
[0004] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0005] To address the problems in related technologies, this invention proposes an intelligent detection method and system for color difference of colored silk based on image analysis, in order to overcome the aforementioned technical problems existing in the existing related technologies.
[0006] Therefore, the specific technical solution adopted by the present invention is as follows:
[0007] According to one aspect of the present invention, an intelligent detection method for color difference in colored silk based on image analysis is provided, the method comprising:
[0008] Collect colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, and use a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image blocks;
[0009] The spectral feature vectors are combined to generate a multidimensional feature matrix. The colored silk characteristic factor is introduced into the multidimensional feature matrix to obtain a multidimensional color difference prediction model. The color difference offset direction of the colored silk image block is identified based on the multidimensional color difference prediction model.
[0010] The color difference score of each colored silk sample image is calculated based on the color difference offset direction, and the color difference score is compared with a preset range. A color difference detection report of colored silk is generated based on the comparison results.
[0011] Preferably, the process involves acquiring colored filament sample images, slicing the colored filament sample images to generate several colored filament image patches, and using a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image patches, including:
[0012] The colored silk sample was acquired using a hyperspectral imaging device and a standard reflectance image was obtained by combining it with whiteboard calibration technology. The standard reflectance image was then subjected to radiometric correction and geometric correction to obtain the colored silk sample image.
[0013] The colored filament sample image is divided into several colored filament image blocks. The colored filament contour regions in the colored filament image blocks are extracted by the Laplacian operator, and the reflectance changes of the colored filament contour regions are calculated by the Sobel operator.
[0014] An inversion gradient model is constructed based on the reflectance variation of the colored filament contour region. The spatial gradient features and spectral derivative features of the colored filament image patch are then generated by inverting the gradient model.
[0015] The spatial gradient features and spectral derivative features are fused after dimensionality reduction, and the spectral feature vectors of the colored filament image blocks are extracted from the fusion result.
[0016] Preferably, an inversion gradient model is constructed based on the reflectance variation of the colored filament contour region. The spatial gradient features and spectral derivative features of the colored filament image patch are generated by inverting the gradient model, including:
[0017] The basic parameters for spectral inversion are set based on the reflectance of the colored filament contour region, and the basic parameters are arbitrarily combined to obtain the inverted spectral parameter set. The inverted spectral parameter set is then subjected to forward modeling to generate forward modeling image samples.
[0018] The Euclidean distance between corresponding positions in the forward modeling image sample and the original colored silk sample image is calculated, and the objective function is constructed based on the Euclidean distance.
[0019] A surrogate model based on spatial-spectral features is constructed and trained according to the objective function. A modified multi-objective evolutionary algorithm is used, combined with the characteristics of colored filaments, to iteratively solve the surrogate model and output the optimal combination of inversion parameters.
[0020] By applying the optimal inversion parameter combination to the colored filament image patch, the local predicted value of the colored filament image patch is obtained, and the local predicted value is transformed into the spatial gradient feature map and spectral derivative feature map of the colored filament image patch.
[0021] Preferably, by using a modified multi-objective evolutionary algorithm and combining iterative solutions to the surrogate model with the characteristics of colored silk, the optimal combination of inversion parameters is output, including:
[0022] The input parameters of the proxy model are used as individuals in the population, and the search range of the inversion parameters is set. Several Doppler maps are generated by traversing the search space of the inversion parameters.
[0023] Doppler sampling indices are selected for each individual in the population, and the Doppler sampling indices are processed by Cartesian projection to obtain the fitness value of each individual in the population.
[0024] Sort the fitness values in descending order, select individuals within the preset range to be assigned to the high-fitness population, and assign the remaining individuals to the low-fitness population.
[0025] The high-fitness population is iteratively updated to generate corresponding mutant individuals, and the low-fitness population is updated near the mutant individuals, and the fitness value of each individual in the population is updated.
[0026] The individual with the highest fitness value is selected as the optimal individual in each iteration, and the fitness value is updated iteratively until the iteration convergence condition is met. The optimal solution of the surrogate model is then output as the optimal inversion parameter combination.
[0027] Preferably, the spectral feature vectors are combined to generate a multidimensional feature matrix, and a colored filament characteristic factor is introduced into the multidimensional feature matrix to obtain a multidimensional color difference prediction model. The identification of the color difference shift direction of the colored filament image patch based on the multidimensional color difference prediction model includes:
[0028] The continuum removal algorithm is used to extract the preferred eigenvectors from the spectral eigenvectors, and the preferred eigenvectors are organized into a multi-dimensional feature matrix according to their spatial location.
[0029] A multidimensional color difference prediction model is obtained by introducing a dynamic texture characteristic factor into the multidimensional feature matrix. The color difference vector output by the multidimensional color difference prediction model is combined with the Mahalanobis color difference to construct a composite color difference component.
[0030] The composite color difference index is mapped to the color space using manifold learning techniques, and the color difference vector field is clustered using directional gradient histograms to identify the main offset direction of colored filament image blocks.
[0031] Preferably, the composite color difference components are mapped to a color space using manifold learning techniques, and the color difference vector field is clustered using histogram of oriented gradients to identify the main offset direction of the colored silk image patch, including:
[0032] The pixel values of the original colored silk sample image are input into a predefined gamma function using mean quantization technology. The composite color difference components are separated by the output of the gamma function to obtain the three primary color components.
[0033] The three primary color components are input into a predefined feature matrix to calculate the tristimulus values of the colors, so as to realize the conversion of the composite color difference components to the color space;
[0034] A color difference histogram is constructed within the colored filament outline region, and fuzziness is calculated using the Lagrange multiplier method. C The membership degree of mean clustering is multiplied by the color difference histogram to obtain the directional gradient histogram;
[0035] The motion estimation vector of the colored filament contour in the colored filament contour region is analyzed, and based on the motion estimation vector, the main offset direction of the colored filament image block is identified in the clustered orientation gradient histogram.
[0036] Preferably, the analysis of the motion estimation vector of the colored filament profile in the colored filament profile region includes:
[0037] Select several contour center points of the colored silk contour region as the origin, construct a horizontal diamond matching window, and calculate the candidate absolute difference sum of the contour center points within the horizontal diamond matching window;
[0038] The candidate absolute difference sum is judged. If the candidate absolute difference sum is the smallest, the next step is executed. Otherwise, the center point of the contour with the smallest candidate absolute difference sum is taken as the new origin, until the smallest candidate absolute difference sum is found.
[0039] Calculate the candidate absolute difference sum for the two adjacent points on both sides of the center point of the contour, and select the minimum value of the candidate absolute difference sum as the motion estimation vector of the colored filament contour in the colored filament contour region.
[0040] Preferably, before using the candidate absolute difference and the contour center point with the smallest value as the new origin, the method further includes:
[0041] Determine the type of the candidate absolute difference and the minimum contour center point. If the minimum contour center point is a far point, continue using the horizontal diamond matching window; if it is a near point, adjust to the vertical diamond matching window.
[0042] Preferably, fuzzy C The expression for the membership degree of mean clustering is:
[0043] ;
[0044] In the formula, x i Indicates the first i A color difference vector of 1 pixel; v k Indicates the first k Cluster centers; u ij Indicates the first i Each pixel belongs to the cluster j Membership degree; m Indicates the fuzzy index; c Indicates the total number of cluster centers; v j Indicates the firstj Cluster centers.
[0045] According to another aspect of the present invention, an intelligent detection system for color difference in colored silk based on image analysis is also provided, the system comprising:
[0046] The spectral feature analysis module is used to acquire colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, and use a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image blocks.
[0047] The color difference prediction module is used to combine spectral feature vectors to generate a multidimensional feature matrix, introduce the colored silk characteristic factor into the multidimensional feature matrix to obtain a multidimensional color difference prediction model, and identify the color difference offset direction of the colored silk image block based on the multidimensional color difference prediction model.
[0048] The test report generation module is used to calculate the color difference score of each colored silk sample image based on the color difference offset direction, compare the color difference score with a preset range, and generate a colored silk color difference test report based on the comparison results.
[0049] The beneficial effects of this invention are as follows:
[0050] 1. This invention utilizes a pre-constructed inversion gradient model to efficiently identify the spectral feature vectors of image blocks, ensuring the efficiency and accuracy of the feature extraction process. By combining these spectral feature vectors to generate a multi-dimensional feature matrix, and combining it with the multi-dimensional color difference prediction model constructed by the colored filament characteristic factor, it can achieve accurate identification of the color difference shift direction, further improving the ability to determine color difference shift, and making the detection still have strong robustness under dynamic and complex conditions.
[0051] 2. This invention extracts contour and reflectance changes using the Laplacian and Sobel operators, effectively separating boundary and color features. It constructs an accurate surrogate model through forward modeling and the Euclidean distance objective function, and combines a multi-objective evolutionary algorithm to efficiently search for optimal inversion parameters, further improving the reliability of spatial gradient and spectral derivative features. This enables the detection method to operate stably under dynamic textures and color gradients, thereby not only improving the automation, accuracy, and repeatability of color difference detection, but also effectively solving color difference defects such as color difference bands, color gradient stripes, and local transition blurring caused by spectral fluctuations, complex surface structures, or process deviations.
[0052] 3. This invention can accurately capture the color difference features of colored silk image blocks by constructing a multidimensional feature matrix and extracting spectral features. It also introduces a dynamic texture characteristic factor, which makes the color difference prediction model more robust and adaptable to different texture and color changes. The introduction of manifold learning technology further improves the mapping accuracy of color difference index in color space, thereby enhancing the accurate identification and analysis of color difference offset direction and effectively distinguishing the main offset direction in complex color changes. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of an intelligent detection method for color difference of colored silk based on image analysis according to an embodiment of the present invention;
[0055] Figure 2 This is a schematic diagram of a color difference intelligent detection system for colored silk based on image analysis according to an embodiment of the present invention.
[0056] Figure 3 This is a flowchart of a method for intelligent detection of color difference in colored silk based on image analysis, according to an embodiment of the present invention, which estimates the motion vector of the colored silk contour.
[0057] In the picture:
[0058] 1. Spectral feature analysis module; 2. Color difference prediction module; 3. Test report generation module. Detailed Implementation
[0059] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.
[0060] According to embodiments of the present invention, a method and system for intelligent detection of color difference in colored silk based on image analysis is provided.
[0061] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, according to an embodiment of the present invention, a method for intelligent detection of color difference in colored silk based on image analysis includes:
[0062] S1. Acquire colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, and use a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image blocks.
[0063] It should be noted that the purpose of the intelligent color difference detection method for colored silk is to achieve high-precision, automated identification and evaluation of minute color difference changes in colored silk images, thereby improving the intelligence and standardization of product quality control. In this method, the main purpose of detecting color difference shift is to accurately capture and identify the direction and magnitude of color changes, especially when colors exhibit subtle, gradual, or localized variations. Color difference shift represents the deviation or trend of color change in different areas of the image. By detecting these shifts, potential problem areas in colored silk images, such as color difference bands, color gradient stripes, and localized blurred transitions, can be effectively located and analyzed.
[0064] The process involves acquiring images of colored filament samples, slicing these images to generate several colored filament image patches, and using a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image patches, including:
[0065] The colored silk sample was acquired using a hyperspectral imaging device and a standard reflectance image was obtained by combining it with whiteboard calibration technology. The standard reflectance image was then subjected to radiometric correction and geometric correction to obtain the colored silk sample image.
[0066] It should be noted that by using a hyperspectral camera equipped with multiple band sensors, colored filament sample image data can be acquired simultaneously in multiple bands. The colored filament sample image data also includes a series of reflectance data at specific wavelengths, thus providing an information basis for subsequent spectral analysis.
[0067] Whiteboard calibration uses a standard object with known reflectivity, typically with high reflectivity and a uniform surface, as a reference for calibrating spectral imaging equipment. By capturing images of the whiteboard, reflectivity response curves of the equipment at different wavelengths are obtained. These response curves are then used to correct for reflectivity measurement biases in the instrument. This process generates a standard reflectivity image, which serves as a reference image for subsequent processing.
[0068] The colored filament sample image is divided into several colored filament image blocks. The colored filament contour regions in the colored filament image blocks are extracted by the Laplacian operator, and the reflectance changes of the colored filament contour regions are calculated by the Sobel operator.
[0069] It should be noted that the Laplacian operator is a second-order differential operator used to detect edges and abrupt changes in an image. It highlights local intensity changes by calculating the second derivative of the gray level around a pixel. Its effect is to accurately extract the contour region in a colored filament image block, that is, to clearly segment the boundary of the filament. The Sobel operator, on the other hand, is a first-order gradient operator, mainly used to calculate the gray level gradient of an image in the horizontal and vertical directions to reflect the direction and magnitude of intensity changes. This invention is used to calculate the reflectance change of the contour region of colored filaments. Its effect is to obtain the local change information of reflectance on each contour line, and then analyze the fine texture and color distribution characteristics of the material.
[0070] An inversion gradient model is constructed based on the reflectance variation of the colored filament contour region. The spatial gradient features and spectral derivative features of the colored filament image patch are then generated by inverting the gradient model.
[0071] Specifically, an inversion gradient model is constructed based on the reflectance variation of the colored filament contour region. The spatial gradient features and spectral derivative features of the colored filament image patch are then generated through the inversion gradient model, including:
[0072] The basic parameters for spectral inversion are set based on the reflectance of the colored filament contour region, and the basic parameters are arbitrarily combined to obtain the inverted spectral parameter set. The inverted spectral parameter set is then subjected to forward modeling simulation to generate forward modeling image samples.
[0073] It should be noted that the basic parameters for spectral inversion are set based on the reflectance of the colored filament contour region. This represents the spectral feature values of the target region extracted from the sample image as input, such as the mapping relationship between reflectance and material properties (dye concentration, surface texture, mixing ratio, etc.). These basic parameters are arbitrarily combined to construct multiple sets of inverted spectral parameters, which represent the existing variations in the colored filament material. The inverted spectral parameter sets are then input into an existing forward model for spectral forward modeling simulation to generate corresponding forward modeling image samples. The effect of these forward modeling image samples is to simulate visual images under different material combinations and spectral responses at the image level, reflecting the appearance differences of images under different parameter combinations, including color changes, spectral reflectance differences, and texture feature changes.
[0074] The Euclidean distance between corresponding positions in the forward modeling image sample and the original colored silk sample image is calculated, and the objective function is constructed based on the Euclidean distance.
[0075] It should be noted that the Euclidean distance is calculated between corresponding positions in the forward image samples and the original colored silk sample images, and the objective function is constructed based on the Euclidean distance, including:
[0076] Spatial registration is performed between the forward-modeled image samples and the original image to ensure a one-to-one correspondence at pixel locations; the multi-band spectral vector is extracted from each corresponding pixel, denoted as […]. S i Represents the orthogonal image of the first i A spectral vector of pixels. O i Represents the original image. i The spectral vector of each pixel; the formula for calculating the Euclidean distance at each pixel location is:
[0077] ;
[0078] In the formula, d i Indicates the first i Spectral distance of pixels, B Indicates the number of spectral bands. S ij Represents the orthogonal image of the first i The pixel in the first j Reflectance values for each band, O ij Represents the original image. i The pixel in the first j The reflectance values of each band; construct an objective function based on the distance values of all pixels, including averaging or summing the distances of all pixels, to measure the overall spectral difference between the forward modeled image and the original image. The smaller the objective function, the closer the forward modeling is to the real sample, and it can be used for subsequent inversion optimization or parameter adjustment.
[0079] A surrogate model based on spatial-spectral features is constructed and trained according to the objective function. A modified multi-objective evolutionary algorithm is used, combined with the characteristics of colored filaments, to iteratively solve the surrogate model and output the optimal combination of inversion parameters.
[0080] It should be noted that the surrogate model for spatial-spectral features is an alternative model used to simulate the complex mapping relationship between inversion parameters and the target image based on the constructed objective function. Surrogate model types include Gaussian process regression, radial basis function neural network, and support vector regression. The model architecture typically consists of an input layer, a hidden layer (for nonlinear mapping), and an output layer. The input is the set of inversion parameters or its encoded representation, and the output is the Euclidean distance objective function value of the corresponding pixel. The core principle is to learn the mapping relationship from inversion spectral parameters to the objective function value on the training dataset, so that in actual inversion, the actual forward modeling process can be indirectly approximated by optimizing the minimum value of the objective function predicted by the surrogate model, thereby improving inversion efficiency and reducing computational resource consumption.
[0081] The model training process includes data preparation (using the Euclidean distance between the forward-modeled image samples and the original image as the supervision target), model initialization, loss function construction (such as minimum mean square error MSE), iterative optimization (such as Adam or SGD algorithms), and accuracy verification, ultimately forming an efficient alternative model that can approximate the response characteristics of the real objective function.
[0082] Among them, by using a modified multi-objective evolutionary algorithm and combining the characteristics of colored silk to iteratively solve the surrogate model, the optimal combination of inversion parameters is output, including:
[0083] The input parameters of the proxy model are used as individuals in the population, and the search range of the inversion parameters is set. Several Doppler maps are generated by traversing the search space of the inversion parameters.
[0084] Doppler sampling indices are selected for each individual in the population, and the Doppler sampling indices are processed by Cartesian projection to obtain the fitness value of each individual in the population.
[0085] It should be noted that the Doppler rate sampling index corresponding to each individual is processed by Cartesian projection, that is, the original one-dimensional index is mapped to a higher-dimensional or regular coordinate system to reflect the positional distribution characteristics of its frequency shift in the spatial structure. By establishing a connection between the mapped point set and the spatial-spectral feature surrogate model, the predicted image performance of each population individual under a specific Doppler rate sampling condition can be calculated, reflecting the degree of matching of the individual parameter combination under the current sampling index. The smaller the fitness, the closer the simulation effect is to the real sample, which is beneficial for further use in genetic optimization or inversion parameter selection.
[0086] Sort the fitness values in descending order, select individuals within the preset range to be assigned to the high-fitness population, and assign the remaining individuals to the low-fitness population.
[0087] The high-fitness population is iteratively updated to generate corresponding mutant individuals, and the low-fitness population is updated near the mutant individuals, and the fitness value of each individual in the population is updated.
[0088] The individual with the highest fitness value is selected as the optimal individual in each iteration, and the fitness value is updated iteratively until the iteration convergence condition is met. The optimal solution of the surrogate model is then output as the optimal inversion parameter combination.
[0089] It should be noted that after selecting the corresponding Doppler rate sampling index for each individual and performing Cartesian projection processing, the fitness value is calculated using a surrogate model to reflect the quality of its inversion effect. Then, mutation operation is performed on individuals with high fitness to generate more diverse parameter combinations. At the same time, the low fitness population is updated in the neighborhood of high fitness to enhance the overall population quality. Finally, the optimal solution of the surrogate model in the search space is output as the optimal combination of inversion parameters. The effect is that the generated simulated image has the smallest error in spectral and spatial features compared with the original sample image, and has high inversion accuracy and stability.
[0090] By applying the optimal inversion parameter combination to the colored filament image patch, the local predicted value of the colored filament image patch is obtained, and the local predicted value is transformed into the spatial gradient feature map and spectral derivative feature map of the colored filament image patch.
[0091] The spatial gradient features and spectral derivative features are fused after dimensionality reduction, and the spectral feature vectors of the colored filament image blocks are extracted from the fusion result.
[0092] S2. Combine the spectral feature vectors to generate a multidimensional feature matrix. Introduce the colored silk characteristic factor into the multidimensional feature matrix to obtain a multidimensional color difference prediction model. Based on the multidimensional color difference prediction model, identify the color difference offset direction of the colored silk image block.
[0093] Specifically, a multidimensional feature matrix is generated by combining spectral feature vectors. A colored filament characteristic factor is then introduced into this multidimensional feature matrix to obtain a multidimensional color difference prediction model. Based on this model, the color difference shift direction of the colored filament image patch is identified, including:
[0094] The continuum removal algorithm is used to extract the preferred eigenvectors from the spectral eigenvectors, and the preferred eigenvectors are organized into a multidimensional feature matrix according to their spatial location.
[0095] It should be noted that the original reflectance spectrum is standardized using the continuum removal method to highlight absorption valleys and reflection features, thereby eliminating background interference. Then, the processed spectral feature vectors are analyzed, and the most representative priority feature vectors for identification are selected based on information such as the depth, position, and shape of the absorption bands. Next, these priority feature vectors are reorganized according to the spatial coordinates of the pixels in the image, that is, they are mapped from one-dimensional spectral vectors to feature matrices on a two-dimensional image structure according to their spatial positions, ultimately forming a multi-dimensional feature matrix.
[0096] A multidimensional color difference prediction model is obtained by introducing a dynamic texture characteristic factor into the multidimensional feature matrix. The color difference vector output by the multidimensional color difference prediction model is combined with the Mahalanobis color difference to construct a composite color difference component.
[0097] It should be noted that by analyzing the spectral fluctuations and texture changes of colored silk images at different time frames or observation angles, statistical features or temporal features describing the dynamic performance of the material are extracted. Then, these dynamic texture factors are concatenated with the spectral-spatial features of each pixel to form a multidimensional input vector.
[0098] A multidimensional color difference prediction model is constructed based on multidimensional input vectors. A deep neural network architecture is adopted, such as a convolutional neural network (CNN) or a spatiotemporal network that integrates temporal features. The model structure consists of an input layer, several hidden layers, and an output layer. The input layer receives multidimensional feature matrix data, the hidden layers extract nonlinear feature relationships, and the output layer predicts the color difference vector. The model training aims to minimize the loss function between the true color difference and the predicted color difference.
[0099] The color difference vector output by the model is combined with the Mahalanobis color difference, that is, the Mahalanobis distance formula based on the color difference vector, mean vector and covariance matrix is used to measure the statistical distance of color differences between samples, thereby constructing a multidimensional color difference prediction model with composite color difference components. The principle is to use Mahalanobis distance to comprehensively consider the correlation and weight of each spectral dimension and dynamic texture characteristics, so that the model can more accurately reflect the small color difference differences under different materials or processes.
[0100] The composite color difference index is mapped to the color space using manifold learning techniques, and the color difference vector field is clustered using directional gradient histograms to identify the main offset direction of colored filament image blocks.
[0101] Specifically, manifold learning is used to map composite color difference components to a color space, and histogram-based clustering of color difference vector fields is used to identify the principal offset directions of colored silk image patches, including:
[0102] The pixel values of the original colored silk sample image are input into a predefined gamma function using mean quantization technology. The composite color difference components are separated by the output of the gamma function to obtain the three primary color components.
[0103] The three primary color components are input into a predefined feature matrix to calculate the tristimulus values of the colors, so as to realize the conversion of the composite color difference components to the color space;
[0104] A color difference histogram is constructed within the colored filament outline region, and fuzziness is calculated using the Lagrange multiplier method. C The membership degree of the mean cluster is multiplied by the color difference histogram to obtain the directional gradient histogram.
[0105] It should be noted that the ambiguity... C The expression for the membership degree of mean clustering is:
[0106] ;
[0107] In the formula, xi Indicates the first i A color difference vector of 1 pixel; v k Indicates the first k Cluster centers; u ik Indicates membership degree, i.e., pixels. i Belongs to clustering j The probability of; m The fuzzy index (ranging from 1.5 to 2.5) controls the softness or hardness of clustering. m →1 indicates a near-hard cluster. m >2 indicates a more fuzzy membership distribution. c Indicates the total number of cluster centers; v j Indicates the first j Cluster centers.
[0108] Among them, the calculation of Lagrange operator multiplication is fuzzy. C The objective function expression for membership degree in mean clustering is:
[0109] ;
[0110] In the formula, F This represents the objective function, which needs to be minimized to optimize clustering. n Indicates the total number of pixels; Indicates the weighted membership degree ( m (Amplifying the effect of high-confidence membership) λ This represents the Lagrange multiplier, used to enforce membership degree normalization constraints; Represents pixels i With cluster center k The square of the Euclidean distance; c Indicates the preset number of clusters; x i Indicates the first i A color difference vector of 1 pixel; v k Indicates the first k Cluster centers.
[0111] The motion estimation vector of the colored filament contour in the colored filament contour region is analyzed, and based on the motion estimation vector, the main offset direction of the colored filament image block is identified in the clustered orientation gradient histogram.
[0112] It should be noted that by using mean quantization and gamma function to perform nonlinear compression and feature enhancement on image pixel values, the color difference information in the original colored silk sample image is more easily mapped to the color space. The gamma function output is used to effectively separate the composite color difference components into the three primary color components (R, G, B), which are then input into the feature matrix to calculate the tristimulus values, thus realizing the conversion from physical color quantities to the perceived color space. The expression is as follows:
[0113] ;
[0114] ;
[0115] ;
[0116] In the formula, R , G , B This represents the three primary color components after gamma correction, each component being processed... R γ , G γ , B γ Perform a nonlinear transformation; γ represents the gamma value; X , Y , Z It represents the tristimulus values of the color space, belongs to the CIE XYZ space, and is used to express the colors perceived by the human eye; M ij This represents the elements in the feature matrix (often called the color space transformation matrix), which are the contributions of different color components to the tristimulus values.
[0117] After constructing the color difference histogram, it is then multiplied by the Lagrange operator and blurred. C Multiplying the membership degrees in mean clustering strengthens the statistical representation of directional gradients in the feature boundary clustering region, thereby improving the direction perception capability of local image structure;
[0118] By combining the motion estimation vector of the colored filament contour region and associating the clustering results with the main direction offset, the main offset direction of the image patch under dynamic texture changes can be identified. This helps to improve the perception stability and discrimination ability of the colored filament material and structural state in subsequent analysis, and enhances the overall description accuracy of the model in both color and structure channels.
[0119] Among them, such as Figure 3 As shown, the analysis of the motion estimation vector of the colored filament profile in the colored filament profile region includes:
[0120] Select several contour center points of the colored silk contour region as the origin, construct a horizontal diamond matching window, and calculate the candidate absolute difference sum of the contour center points within the horizontal diamond matching window;
[0121] The candidate absolute difference sum is judged. If the candidate absolute difference sum is the smallest, the next step is executed. Otherwise, the center point of the contour with the smallest candidate absolute difference sum is taken as the new origin, until the smallest candidate absolute difference sum is found.
[0122] The process of using the contour center point with the smallest sum of candidate absolute differences as the new origin also includes:
[0123] Determine the type of the candidate absolute difference and the minimum contour center point. If the minimum contour center point is a far point, continue using the horizontal diamond matching window; if it is a near point, adjust to the vertical diamond matching window.
[0124] Calculate the candidate absolute difference sum for the two adjacent points on both sides of the center point of the contour, and select the minimum value of the candidate absolute difference sum as the motion estimation vector of the colored filament contour in the colored filament contour region.
[0125] It should be noted that by introducing horizontal and vertical diamond matching windows to estimate the motion of the center point of the colored filament contour, it is possible to efficiently search and identify directional features of color or shape changes within a local area, thereby accurately inferring the main offset trend of the colored filament image block and improving the structure tracking accuracy under dynamic texture changes. The horizontal diamond matching window is used to prioritize the search in the horizontal direction, which is suitable for handling contour center points with large displacements in the case of far points, while the vertical diamond matching window is suitable for the near point area to enhance the local search capability in the vertical direction, forming an adaptive search strategy. Throughout the search process, the search center point is dynamically updated by using the candidate absolute difference sum (i.e., the total difference in pixel values) as the criterion, and combined with the difference analysis of the adjacent points on both sides, the motion estimation vector of the colored filament contour describing the motion trend is finally derived, which improves the continuity and directionality of contour tracking.
[0126] The following section provides a further explanation of the motion estimation vector of the colored filament contour in the colored filament contour region, using specific implementation methods.
[0127] Step 1: Arbitrarily set a two-dimensional image region containing several contour points to form a colored wire contour region. The positions of these points in the image can be represented as a set of coordinates. For example, suppose the coordinates of 5 contour center points are selected as (10, 15), (20, 25), (30, 35), (40, 45), (50, 55);
[0128] Step 2: The horizontal diamond matching window is used to expand the search in the horizontal direction. Assume that the size of this window is 3×3, and the center of the matching window is the center point of the contour.
[0129] Step 3: Within the current matching window, calculate the sum of the absolute differences between the center point of the contour and other points within the window, using the absolute differences in pixel values as the standard. Assume the pixel values of the contour center point (10, 15) are 120; the neighboring pixels are 130, 140, 150, and 160. For the first contour center point (10, 15), the nearby pixel values are (9, 14): 130, (11, 14): 140, (9, 15): 150, (11, 15): 160. Calculate the sum of the absolute differences for this contour point:
[0130] Sum of differences = ;
[0131] Step 4: After calculating the sum of candidate absolute differences for each contour center point, select the contour center point corresponding to the smallest sum of differences. If the smallest sum of differences meets the condition, proceed to the next step; otherwise, update the contour center point to the point containing the smallest sum of differences.
[0132] Step 5: Determine the type based on the smallest candidate absolute difference and the corresponding contour center point:
[0133] Far point: If the contour point is located at a far position, a horizontal diamond matching window is used for further calculation.
[0134] Nearest point: If the contour point is located in a relatively close position, a vertical diamond matching window is used for local vertical search.
[0135] If (10, 15) is a far point, continue to use a horizontal diamond matching window for calculation; if (20, 25) is a near point, adjust to a vertical diamond matching window.
[0136] Step 6: For each contour center point, calculate the candidate absolute difference sum of its two adjacent points. For point (10, 15), calculate the difference sum of its left and right adjacent points and select the smallest difference sum. Assume the left side is (9, 15) and the right side is (11, 15). Calculate the two difference sums and take the minimum value.
[0137] Step 7: By using candidate absolute differences and judging the minimum value and updating the center point, the motion estimation vector is finally calculated. This vector represents the motion trend of the contour. Assuming that the final calculated motion estimation vector at point (30, 35) is (5, 10), it means that the contour moves in the direction of 5 units in the horizontal direction and 10 units in the vertical direction at that position.
[0138] S3. Calculate the color difference score for each colored silk sample image based on the color difference offset direction, compare the color difference score with the preset range, and generate a colored silk color difference detection report based on the comparison results.
[0139] It should be noted that, to calculate the color difference score for each colored silk sample image based on the color difference offset direction, firstly, the color difference offset direction information needs to be extracted from the colored silk contour region and mapped to the color difference vector of each pixel. The projection component of the color difference in the principal direction is calculated using direction weighting or vector projection. Then, the average or maximum projection value of the entire image is obtained as the color difference score. Next, the obtained color difference score is compared with a preset color difference threshold range. If the score is below the threshold, the color difference is considered to be within an acceptable range; otherwise, it is considered to exceed the standard. Based on the comparison results, a colored silk color difference detection report is generated, containing information such as the color difference score, color difference offset direction, judgment conclusion, and possible color difference exceeding the standard area markers, facilitating quality control and subsequent analysis.
[0140] According to another embodiment of the invention, such as Figure 2 As shown, an intelligent color difference detection system for colored silk based on image analysis is also provided. This system includes:
[0141] Among them, the spectral feature analysis module 1 is connected to the color difference prediction module 2, and the color difference prediction module 2 is connected to the test report generation module 3;
[0142] Spectral feature analysis module 1 is used to acquire colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, and use a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image blocks.
[0143] Color difference prediction module 2 is used to combine spectral feature vectors to generate a multidimensional feature matrix, introduce colored silk characteristic factors into the multidimensional feature matrix to obtain a multidimensional color difference prediction model, and identify the color difference offset direction of the colored silk image block based on the multidimensional color difference prediction model.
[0144] The detection report generation module 3 is used to calculate the color difference score of each colored silk sample image based on the color difference offset direction, compare the color difference score with the preset range, and generate a colored silk color difference detection report based on the comparison result.
[0145] 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 method for intelligent detection of color difference in colored silk based on image analysis, characterized in that, The method includes: Collect colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, divide the colored filament sample images into several colored filament image blocks, extract the colored filament contour regions in the colored filament image blocks, and calculate the reflectance changes of the colored filament contour regions. The basic parameters for spectral inversion are set based on the reflectance of the colored filament contour region, and the basic parameters are arbitrarily combined to obtain the inverted spectral parameter set. The inverted spectral parameter set is then subjected to forward modeling to generate forward modeling image samples. The Euclidean distance between corresponding positions in the forward modeling image sample and the original colored silk sample image is calculated, and the objective function is constructed based on the Euclidean distance. A surrogate model based on spatial-spectral features is constructed and trained according to the objective function. A modified multi-objective evolutionary algorithm is used, combined with the characteristics of colored filaments, to iteratively solve the surrogate model and output the optimal combination of inversion parameters. The local predicted values of the colored filament image patch are obtained by applying the optimal inversion parameter combination to the colored filament image patch. The local predicted values are then transformed into the spatial gradient feature map and spectral derivative feature map of the colored filament image patch. The spatial gradient features and spectral derivative features are fused after dimensionality reduction, and the spectral feature vectors of the colored filament image blocks are extracted from the fusion result. The continuum removal algorithm is used to extract the preferred eigenvectors from the spectral eigenvectors, and the preferred eigenvectors are organized into a multi-dimensional feature matrix according to their spatial location. A multidimensional color difference prediction model is obtained by introducing a dynamic texture characteristic factor into the multidimensional feature matrix. The color difference vector output by the multidimensional color difference prediction model is combined with the Mahalanobis color difference to construct a composite color difference component. The composite color difference index is mapped to the color space using manifold learning techniques, and the color difference vector field is clustered using the directional gradient histogram to identify the main offset direction of the colored silk image block. The color difference score of each colored silk sample image is calculated based on the color difference offset direction, and the color difference score is compared with a preset range. A color difference detection report of colored silk is generated based on the comparison results.
2. The intelligent detection method for color difference of colored silk based on image analysis according to claim 1, characterized in that, The process of acquiring colored filament sample images, slicing the colored filament sample images to generate several colored filament image blocks, dividing the colored filament sample images into several colored filament image blocks, extracting the colored filament contour regions in the colored filament image blocks, and calculating the reflectance changes of the colored filament contour regions includes: The colored silk sample was acquired using a hyperspectral imaging device and a standard reflectance image was obtained by combining it with whiteboard calibration technology. The standard reflectance image was then subjected to radiometric correction and geometric correction to obtain the colored silk sample image. The colored filament sample image is divided into several colored filament image blocks. The colored filament contour regions in the colored filament image blocks are extracted by the Laplacian operator, and the reflectance changes of the colored filament contour regions are calculated by the Sobel operator.
3. The intelligent detection method for color difference of colored silk based on image analysis according to claim 1, characterized in that, The method of using a modified multi-objective evolutionary algorithm, combined with the characteristics of colored silk, to iteratively solve the surrogate model and output the optimal combination of inversion parameters includes: The input parameters of the proxy model are used as individuals in the population, and the search range of the inversion parameters is set. Several Doppler maps are generated by traversing the search space of the inversion parameters. Doppler sampling indices are selected for each individual in the population, and the Doppler sampling indices are processed by Cartesian projection to obtain the fitness value of each individual in the population. Sort the fitness values in descending order, select individuals within the preset range to be assigned to the high-fitness population, and assign the remaining individuals to the low-fitness population. The high-fitness population is iteratively updated to generate corresponding mutant individuals, and the low-fitness population is updated near the mutant individuals, and the fitness value of each individual in the population is updated. The individual with the highest fitness value is selected as the optimal individual in each iteration, and the fitness value is updated iteratively until the iteration convergence condition is met. The optimal solution of the surrogate model is then output as the optimal inversion parameter combination.
4. The intelligent detection method for color difference of colored silk based on image analysis according to claim 1, characterized in that, The process of mapping composite color difference components to a color space using manifold learning techniques and clustering the color difference vector field using histogram of oriented gradients to identify the main offset direction of colored silk image patches includes: The pixel values of the original colored silk sample image are input into a predefined gamma function using mean quantization technology. The composite color difference components are separated by the output of the gamma function to obtain the three primary color components. The three primary color components are input into a predefined feature matrix to calculate the tristimulus values of the colors, so as to realize the conversion of the composite color difference components to the color space; A color difference histogram is constructed within the colored filament outline region, and fuzziness is calculated using the Lagrange multiplier method. C The membership degree of mean clustering is multiplied by the color difference histogram to obtain the directional gradient histogram; The motion estimation vector of the colored filament contour in the colored filament contour region is analyzed, and based on the motion estimation vector, the main offset direction of the colored filament image block is identified in the clustered orientation gradient histogram.
5. The intelligent detection method for color difference of colored silk based on image analysis according to claim 4, characterized in that, The analysis of the colored filament contour region includes the following motion estimation vector: Select several contour center points of the colored silk contour region as the origin, construct a horizontal diamond matching window, and calculate the candidate absolute difference sum of the contour center points within the horizontal diamond matching window; The candidate absolute difference sum is judged. If the candidate absolute difference sum is the smallest, the next step is executed. Otherwise, the center point of the contour with the smallest candidate absolute difference sum is taken as the new origin, until the smallest candidate absolute difference sum is found. Calculate the candidate absolute difference sum for the two adjacent points on both sides of the center point of the contour, and select the minimum value of the candidate absolute difference sum as the motion estimation vector of the colored filament contour in the colored filament contour region.
6. The intelligent detection method for color difference of colored silk based on image analysis according to claim 5, characterized in that, The step of using the candidate absolute difference and the minimum contour center point as the new origin also includes: Determine the type of the candidate absolute difference and the minimum contour center point. If the minimum contour center point is a far point, continue using the horizontal diamond matching window; if it is a near point, adjust to the vertical diamond matching window.
7. The intelligent detection method for color difference of colored silk based on image analysis according to claim 6, characterized in that, The ambiguity C The expression for the membership degree of mean clustering is: ; In the formula, x i Indicates the first i A color difference vector of 1 pixel; v k Indicates the first k Cluster centers; u ij Indicates the first i Each pixel belongs to the cluster j Membership degree; m Indicates the fuzzy index; c Indicates the total number of cluster centers; v j Indicates the first j Cluster centers.
8. An intelligent detection system for color difference in colored silk based on image analysis, used to implement the intelligent detection method for color difference in colored silk based on image analysis as described in any one of claims 1-7, characterized in that, The system includes: The spectral feature analysis module is used to acquire colored filament sample images, slice the colored filament sample images to generate several colored filament image blocks, and use a pre-built inversion gradient model to identify the spectral feature vectors of the colored filament image blocks. The color difference prediction module is used to combine spectral feature vectors to generate a multidimensional feature matrix, introduce the colored silk characteristic factor into the multidimensional feature matrix to obtain a multidimensional color difference prediction model, and identify the color difference offset direction of the colored silk image block based on the multidimensional color difference prediction model. The test report generation module is used to calculate the color difference score of each colored silk sample image based on the color difference offset direction, compare the color difference score with a preset range, and generate a colored silk color difference test report based on the comparison results.
Citation Information
Patent Citations
Online detection system and method for printing and dyeing chromatic aberration and medium
CN118758429A
Wood color difference online detection method based on spectral reflectivity reconstruction
CN119379625A