Automobile paint film color identification and classification method combining hyperspectrum and support vector
Through the combination of hyperspectral imaging technology and support vector machines, the problems of low accuracy and strict environmental requirements in automotive paint film color measurement are solved, and high-precision color recognition and classification under complex conditions are achieved.
Patent Information
- Application Number
- CN202411822302.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The prior art has problems such as low accuracy, strict environmental requirements, and limited scope of application in the color measurement of automotive paint films, making it difficult to achieve high-precision measurement in complex occasions.
Hyperspectral imaging technology combined with support vector machine (SVM) is used to obtain hyperspectral images of automotive paint films through hyperspectral cameras, perform spectral preprocessing and feature wavelength extraction, construct an SVM prediction classification model, and screen abnormal colors with single-class support vector machine (OC-SVM).
It realizes the rapid and accurate identification and classification of automotive paint film colors under complex conditions, reduces the impact of ambient light and material complex characteristics on measurements, and improves measurement accuracy and efficiency.
Smart Images

Figure CN119723347A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and machine learning, and in particular to a method for identifying and classifying automobile paint film colors by combining a hyperspectral spectrum and a support vector. Background Art
[0002] The car paint film is an important factor affecting the appearance quality of the car. It not only protects the car body and improves the appearance, but also plays an auxiliary role in reflecting and identifying vehicle information. Every year, automobile manufacturers suffer countless material waste, cost increases and customer losses due to paint film spraying errors. Therefore, accurate identification and classification of paint film color types is a key link in automobile manufacturing and evaluation, which is of great significance to improving production efficiency, reducing material waste and improving product quality. In addition, accurate paint film color recognition can also provide objective and consistent color information for fields such as automobile maintenance, insurance, and used car evaluation, providing standardized and automated solutions for related industries.
[0003] Currently, spectrophotometry (also known as spectral photometry) is the most widely used high-precision color measurement method. This method calculates the tristimulus values by measuring the spectral power of the sample, and then determines the chromaticity coordinates and other color parameters of the sample. Spectrophotometers have high measurement accuracy and wide applicability, but they are expensive and can only perform single-point measurements of small areas. They also have extremely strict requirements on the surface flatness, color distribution uniformity and other characteristics of the sample being measured, as well as the lighting conditions during measurement. The measurement process is cumbersome and complicated, resulting in low measurement efficiency.
[0004] Given that the materials tested on the automotive paint color inspection line are usually large in area, with variable curvatures and shapes, it is difficult to maintain a consistent lighting environment in the workshop, and spectrophotometers are difficult to achieve the various color measurement conditions required for high-precision measurement, which makes them have great limitations. In addition, in recent years, the defects of various traditional color measurement methods, including spectrophotometers, have become increasingly obvious in many complex color measurement occasions; with the rapid development of hyperspectral recognition technology, hyperspectral color measurement technology has begun to emerge in the field of color measurement.
[0005] Compared with traditional color measurement methods, hyperspectral imaging technology can achieve "image and spectrum integration". Most hyperspectral cameras use "push-broom" imaging, which can obtain the two-dimensional array information of the sample and the spectral information of each pixel, which is conducive to a more comprehensive analysis of the data, making it easier to eliminate local errors. The acquired spectral information can be processed by various algorithms to greatly reduce the impact of factors such as ambient light or the complex characteristics of the material itself, thereby reducing the requirements for measurement conditions. In recent years, many scholars in related fields at home and abroad have proposed the application of hyperspectral color measurement methods to industries such as textiles, archaeology, and jewelry, but their research results on the color characterization of experimental materials are mostly limited to the three-stimulus value colorimetric characterization method under the CIE system, and have not completely overcome the defects of traditional color measurement methods.
[0006] Through the above analysis, the problems and defects of the prior art are as follows:
[0007] Good measurement accuracy can only be achieved when measuring the color of samples with a flat surface and uniform color distribution (such as textiles), which has great limitations in the workplace;
[0008] The working environment requirements for color measurement are relatively strict, and the measured data is often only applicable to the same working environment. Once the working environment changes, the previously obtained data will not be of much significance.
[0009] In summary, the present invention provides a method for identifying and classifying automobile paint film color by combining hyperspectral and support vector. Summary of the invention
[0010] In order to solve the problems existing in the prior art, the present invention provides a method for identifying and classifying automobile paint film colors by combining hyperspectral and support vector.
[0011] A method for identifying and classifying automobile paint film color by combining hyperspectral and support vector is implemented by the following steps:
[0012] Step 1: Select a variety of standard paint film color cards and divide them into seven groups, each group of four color cards are similar colors, set the imaging conditions under the experimental light source with uniform illumination, use a hyperspectral camera to image each group of color cards to obtain a hyperspectral image of each group of color cards, and pre-process the hyperspectral image to obtain spectral reflectance information;
[0013] Step 2: Use a continuous projection algorithm to perform dimension reduction processing on the spectral reflectance information of the visible light band of each color card by group, extract the characteristic wavelength of each group of color cards, and the four color cards in each group have the same characteristic wavelength; select an initial characteristic wavelength combination;
[0014] Step 3: Simulate complex imaging conditions and perform imaging measurements;
[0015] Simulate complex imaging conditions that are different from the imaging conditions described in step 1 to perform imaging, obtain spectral reflectance information of each group of colors under the complex imaging conditions, and then repeat the operation of step 2 to obtain characteristic wavelength data;
[0016] Compare the characteristic wavelength data with the preliminary characteristic wavelength combination selected in step 2, perform secondary screening on the initial characteristic wavelengths, and use the screened characteristic wavelengths as label vectors of a support vector machine;
[0017] Step 4: Use the label vector described in step 3 as a training sample for a support vector machine, and train the support vector machine so that it can accurately identify and classify the color of the paint film; at the same time, use the training set to train the single-class support vector machine so that the single-class support vector machine can screen and identify abnormal colors; and combine the single-class support vector machine and the support vector machine to form a recognition and classification model for the color of automobile paint films.
[0018] Beneficial effects of the present invention:
[0019] The automobile paint film color recognition and classification method described in the present invention obtains spectral reflection information through a spectral preprocessing algorithm and a pixel point screening algorithm based on spectral matching angle theory, thereby greatly eliminating the recognition error caused by the change of the surface curvature of the inspected material; extracts and integrates the paint film color spectral characteristics under various imaging conditions, constructs an SVM prediction and classification model suitable for the automobile paint film color evaluation production line, and combines OC-SVM to screen out the inspected materials with color spraying abnormalities on the production line. The overall model not only has the color measurement capability under complex conditions that traditional colorimeter lacks, but can also quickly and accurately determine the color type of automobile paint films. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 The present invention is a flowchart of a method for identifying and classifying automobile paint film color by combining hyperspectral and support vector.
[0021] Figure 2 This is a flow chart of the present invention for screening all pixels in each sample ROI area. DETAILED DESCRIPTION
[0022] Combination Figure 1 and Figure 2This embodiment describes a method for color recognition and classification of automobile paint films that combines hyperspectral and support vectors. This method performs color recognition and classification on several automobile shell materials of different colors on a production line, and is achieved by imaging and analyzing the target materials with a hyperspectral camera. In this embodiment, a hyperspectral camera is used to image the inspected material. Its spectral range should cover the visible light band, i.e., 380-780nm, and the spectral resolution should be ≤10nm. The distance between the camera lens and the inspected material depends on the actual situation, ensuring that all inspected materials can be clearly imaged; the lighting conditions should have a certain stability to ensure that the surface of the inspected material is fully and evenly illuminated during the measurement.
[0023] The method for identifying and classifying the color of automobile paint films described in this embodiment is implemented by the following steps:
[0024] Step 1. According to the specific paint film color type to be identified in the actual project, select the corresponding color card set and color number; select 28 common colors of automobile paint films from the GSB05-1426-2001 standard paint film color card set, divide them into 7 groups, and the 4 colors in each group are approximate colors. Under the experimental light source with uniform illumination, lay the color card flat on the experimental table, use the hyperspectral camera imaging to obtain its hyperspectral image (spectral image under ideal conditions), perform preprocessing operations and pixel point screening to obtain spectral reflectance information (ideal condition sample data); the 7 groups are:
[0025] Group 1: B06-light sky blue, B07-egg blue, B08-childish blue, BG05-light lake green;
[0026] Group 2: Y11-cream, Y02-pearl, Y03-cream, Y04-ivory;
[0027] Group 3: B04-silver gray, B05-sea gray, G10-aircraft gray, BG01-medium green gray;
[0028] Group 4: GY02-spinning green, GY04-grass green, GY05-brown green, GY06-olive green;
[0029] Group 5: G01-apple green, G08-light apple green, GY01-bean green, GY08-fruit green;
[0030] Group 6: YR04-orange, R02-vermilion, R03-scarlet, R05-orange;
[0031] Group 7: YR09-iron yellow, YR06-brown yellow, YR01-light brown, YR07-dark brown yellow;
[0032] In this embodiment, under the experimental light source, each group of standard paint film color cards are laid flat on the camera imaging area. In order to obtain sufficient data to reduce accidental errors, multiple imaging is performed to obtain high-spectral images of each group of color cards while ensuring uniform illumination, and the region of interest (ROI) is extracted for each image to obtain the original spectral information in the area, and preprocessing operations are performed at the same time; the original spectral information is mixed with a lot of data noise such as light source, camera dark current, ambient stray light and shadow. When preprocessing the spectral information of the ROI area, the black and white plate correction formula is first used to eliminate the influence of the light source, ambient light and camera dark current, so as to obtain the initial reflectivity data curve; then SG smoothing is performed to remove part of the random noise and improve the signal accuracy; then the multivariate scattering correction (MSC) algorithm is used to eliminate scattering and part of the spectral differences caused by the change of the curvature of the material surface; finally, according to the spectral matching angle formula, the spectral similarity test is performed for all the pixels in the collected area, and finally a part of the pixels closest to the actual value in the ROI area is screened out to extract its spectral reflectance information.
[0033] In this embodiment, any medium with hyperspectral image processing function is used to extract the ROI area. In this embodiment, MATLAB and ENVI software are used. The specific process of preprocessing the ROI area is as follows:
[0034] Step 1-1: Use the black and white plate correction formula to perform black and white balance and dark current correction, and calculate the initial spectral reflectance:
[0035]
[0036] Where, DN raw is the original spectral image response value, DN white Calibrate the image response value for the standard white plate, DN dc is the blackboard calibration image response value, R ref The standard white board is imaged using a hyperspectral camera to obtain the standard white board calibration image response value DN white ; Cover the camera lens with a lens cap to obtain the blackboard calibration image response value DN dc ;
[0037] Step 1-2: Use SG smoothing to process some random noise in the spectral curve; assuming that the smoothing window width is n=2m+1 and the expected number of fitting curves is k, use a k-1 polynomial to fit the data points in the window:
[0038] y=a0+a1x+a2x 2 +…+a k-1 x k-1
[0039] Solve the least squares problem to obtain the fitting parameters a0 to a k :
[0040]
[0041] In matrix form:
[0042] Y (2m+1)×1 =X (2m+1)×k ·A K×1 +E (2m+1)×1
[0043] Among them, X is the fitting point matrix, Y is the actual value matrix, and A is the SG fitting parameter matrix; the least squares solution matrix of A can be obtained from the above formula: for:
[0044]
[0045] Then we can get the fitting parameter values and the y prediction value matrix Y under the conditions of 2m+1 window width and k-order polynomial fitting. SG :
[0046] Y SG =X·A=X·(X T ·X) -1 ·X T ·Y=B·Y
[0047] Where B = X·(X T ·X) -1 ·X T .
[0048] Step 1-3: Use the MSC algorithm to eliminate scattering errors. When performing MSC correction on a certain ROI area, the average spectrum of all sample points in the area must be obtained first.
[0049]
[0050] Among them, x ij is the spectral reflectance value of the i-th sample in the j-th band, and n is the total number of samples; then the spectrum of each sample point is subjected to a univariate linear regression relative to the average spectrum, and the least squares fitting formula for each sample is obtained as follows:
[0051]
[0052] Among them, x i represents the i-th sample, k i With b iare the offset and translation of each sample spectral curve compared to the baseline, respectively. Solving the least squares problem can obtain the corresponding values. Finally, the obtained baseline offset and translation are used to perform spectral correction:
[0053]
[0054] In the formula, x MSC This is the spectrum information after MSC correction. It should be noted that the experimental materials used in actual projects are often pure color materials with uniform color distribution. If there is no obvious scattering noise on the original spectrum curve of some materials, the MSC correction step can be omitted according to the situation to prevent overfitting.
[0055] Step 1-4: The spectral reflectance curve obtained after the above preprocessing is used to screen out a portion of pixels with the highest similarity in the ROI area according to the spectral matching angle theory to ensure that the data reflects the true value of the ROI area as much as possible; the spectral matching angle formula of the two spectral curves is as follows:
[0056]
[0057] Among them, X k , Y k are the spectral reflectance values of the two spectral curves in the kth band, θ SAM is the SAM angle of the two; θ SAM The smaller the value, the higher the similarity of the two spectral lines. According to the actual imaging situation, when θ SAM When the value is less than a certain threshold, two spectral lines can be considered to come from the same color.
[0058] like Figure 2 As shown in the figure, the average spectrum of all pixels in the ROI area of a certain type of paint film color image is taken, which is regarded as the "ideal spectrum". According to the spectral matching, the screening threshold is set, and the part with the highest similarity to the ideal spectrum is screened out from the spectral reflectance curves of all pixels in the ROI area as the spectral reflectance information of the paint film color in the ROI area. The specific process is as follows:
[0059] Step A, calculate the average spectrum of the ROI area, and initialize the number of cycles I=1;
[0060] Step B, calculating the SAM angle between the spectrum of the 1st pixel point in the ROI area and the average spectrum;
[0061] Step C, determining whether the SAM angle calculated in step B exceeds a preset threshold, if yes, removing the point and executing step D; otherwise, retaining the point and executing step D;
[0062] Step D, the number of loops + 1, determine whether the number of loops reaches the total number of pixels N in the ROI area, if yes, end; otherwise, return to step B.
[0063] Step 2: Based on the Successive Projection Algorithm (SPA), the spectral reflectance information of the visible light band of each color card is subjected to dimension reduction processing by group, and the initial characteristic wavelength of the color cards of each color group under the imaging conditions described in step 1 is preliminarily extracted, and the four color cards in each group have the same characteristic wavelength;
[0064] In this embodiment, the SPA method is used to extract the characteristic wavelengths of various paint film materials. According to the principle of the SPA method, the hyperspectral camera and all wavelengths in the visible light band are used as initial bands in turn to perform feature extraction operations to obtain multiple groups of characteristic wavelengths. Combined with cross-validation and multivariate regression models, statistical tests and judgments are performed using prediction error square, PRESS regression judgment criteria and other judgment criteria, and the initial characteristic wavelength group (characteristic wavelength) is selected based on the judgment results.
[0065] Step 3: Simulate complex imaging conditions and perform imaging measurements for typical conditions that may occur in actual automobile paint film color recognition and affect the final recognition results. In this embodiment, three types of complex imaging conditions that may occur in actual engineering are simulated, namely: changes in light source type, changes in illumination angle, and changes in material surface curvature. An experimental environment that meets the above three conditions is built, and imaging operations are performed on the corresponding experimental materials. The operation procedures in steps 1 and 2 are repeated for their hyperspectral data to obtain characteristic wavelength data again. At this point, the characteristic wavelength extraction results of the standard paint film color in all imaging conditions are integrated and analyzed, and more representative characteristic variables are screened out to form a label vector of the support vector machine. The specific operations are as follows:
[0066] The illumination angle of the experimental light source in step 1 is changed to perform multiple imaging; various common working light sources different from the experimental light source in step 1 are replaced to perform multiple imaging; multiple imaging is performed using multiple automobile shell molds with the same color as the paint film color card in step 1 and with a curvature change on the surface; a large number of imaging results under the above three types of complex imaging conditions (spectral images under complex conditions) are used to perform data processing again according to the operation sequence in step 1 to obtain spectral reflectance information of each group of colors under the three types of conditions (complex condition sample data);
[0067] SPA feature extraction is performed again for the spectral reflectance information obtained under the three types of complex imaging conditions, and the characteristic wavelengths under the three types of complex conditions (characteristic wavelengths under complex conditions) are extracted and compared with the initial characteristic wavelength group obtained in step 2. The characteristic wavelengths of each color group are screened twice, and usually a part of the characteristic wavelengths in the initial characteristic wavelength group that are less representative and more sensitive to changes in the light source and material surface are screened out; after screening, the final characteristic wavelength group for each color group is obtained.
[0068] At this point, a large amount of spectral reflectance information obtained from each group of paint film colors under all imaging conditions is integrated into a unified data set, and the data set is reduced in dimension according to the final characteristic wavelength group of the group of colors. The reduced-dimensional data set is used as the label vector data set of the group of colors.
[0069] Step 4: Use the label vector data set as a training sample for a support vector machine, so that the support vector machine has the ability to accurately identify and classify paint film colors; at the same time, use the same data set to train a single-class support vector machine, so that the single-class support vector machine has the ability to screen and identify abnormal colors; a recognition and classification system for automobile paint film colors is composed of a single-class support vector machine and a support vector machine, which has both sample color classification and abnormal color screening functions.
[0070] In this embodiment, a large number of label vectors (training sets) of each paint film color are used to carry out SVM model training; first, a single-class support vector machine (OC-SVM) model is used to perform detection and screening training on samples with abnormal colors; the training set is input into the OC-SVM model, and the entire data set is classified as a normal sample set by reasonably selecting the kernel function and related parameters; thereby enabling the model to have the ability to identify and filter out abnormal samples; when a new color data is input into the model, it is first detected as abnormal by the OC-SVM, and then color recognition and classification is performed by the SVM. If the input data is determined to be an abnormal sample by the trained OC-SVM model, it is directly eliminated without subsequent recognition and classification operations;
[0071] In this embodiment, a support vector machine (SVM) is used to complete the recognition and classification of paint film colors; the label vector data set of each group of paint film colors is used as input features, and the paint film color category is used as the output label; then, cross-validation and network search methods are used to optimize the hyperparameters of the SVM model, including kernel function type, kernel function parameters, penalty coefficient, etc.; finally, the optimized SVM model is used to predict new paint film color samples, thereby realizing automatic recognition and classification of paint film colors.
[0072] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A method for identifying and classifying automobile paint film color by combining hyperspectral and support vector, characterized by: The method is implemented by the following steps: Step 1: Select a variety of standard paint film color cards and divide them into seven groups, each group of four color cards are similar colors, set the imaging conditions under the experimental light source with uniform illumination, use a hyperspectral camera to image each group of color cards to obtain a hyperspectral image of each group of color cards, and pre-process the hyperspectral image to obtain spectral reflectance information; Step 2: Use a continuous projection algorithm to perform dimension reduction processing on the spectral reflectance information of the visible light band of each color card by group, extract the characteristic wavelength of each group of color cards, and the four color cards in each group have the same characteristic wavelength; select an initial characteristic wavelength combination; Step 3: Simulate complex imaging conditions and perform imaging measurements; Simulate complex imaging conditions that are different from the imaging conditions described in step 1 to perform imaging, obtain spectral reflectance information of each group of colors under the complex imaging conditions, and then repeat the operation of step 2 to obtain characteristic wavelength data; Compare the characteristic wavelength data with the preliminary characteristic wavelength combination selected in step 2, perform secondary screening on the initial characteristic wavelengths, and use the screened characteristic wavelengths as label vectors of a support vector machine; Step 4: Use the label vector described in step 3 as a training sample for a support vector machine, and train the support vector machine so that it can accurately identify and classify the color of the paint film; at the same time, use the training set to train the single-class support vector machine so that the single-class support vector machine can screen and identify abnormal colors; and combine the single-class support vector machine and the support vector machine to form a recognition and classification model for the color of automobile paint films.
2. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 1, characterized in that: In step 1, each set of standard paint film color cards is laid flat on the camera imaging area to collect a hyperspectral image, and the ROI area is extracted to obtain the original spectral information in the ROI area, and the original spectral information is preprocessed; the preprocessing process is: Firstly, the black and white plate correction formula is used to eliminate the influence of light source, ambient light and camera dark current to obtain the initial reflectivity data curve; Then the SG smoothing process removes some random noise; the MSC algorithm is then used to eliminate scattering and spectral differences caused by changes in the curvature of the material surface; Finally, according to the spectral matching angle formula, the spectral similarity test is performed on all the pixels in the collected area, and finally the pixel closest to the actual value in the ROI area is screened out to extract its spectral reflectance information.
3. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 2, characterized in that: The specific process of extracting the spectral reflectance information of the pixel point closest to the actual value in the ROI area is: Step A, calculate the average spectrum of the ROI area, and initialize the number of cycles to 0; Step B, calculating the SAM angle between the spectrum of the i-th pixel point in the ROI area and the average spectrum; Step C, determining whether the SAM angle calculated in step B exceeds a preset threshold, if yes, removing the point and executing step D; otherwise, retaining the point and executing step D; Step D, add 1 to the number of loops, and determine whether the number of loops reaches the total number of pixels N in the ROI area. If yes, end; Otherwise, return to step B.
4. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 1, characterized in that: In step 2, according to the principle of SPA algorithm, the hyperspectral camera and all wavelengths in the visible light band are used as initial bands in turn to perform feature extraction operations to obtain multiple groups of characteristic wavelengths; cross-validation and multivariate regression models are used to perform statistical tests and judgments on the characteristic wavelengths, and a preliminary characteristic wavelength combination is selected based on the judgment results.
5. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 1, characterized in that: In step three, the complex imaging conditions are divided into three categories, namely: changing the illumination angle of the experimental light source in step one for imaging; replacing a light source different from the experimental light source in step one for imaging; and using a variety of automobile shell molds with the same color as the paint film color card in step one and with a surface curvature change for imaging.
6. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 1, characterized in that: In step 4, the training set is input into the one-class support vector machine, and the entire training set is classified as a normal sample set by selecting a kernel function and related parameters; the one-class support vector machine is enabled to identify and filter out abnormal samples; when new color data is input into the one-class support vector machine, the one-class support vector machine performs anomaly detection, and then the support vector machine performs color recognition and classification; if the input data is determined to be an abnormal sample by the trained one-class support vector machine, it is directly eliminated.
7. The method for identifying and classifying automobile paint film color by combining hyperspectral and support vector according to claim 1, characterized in that: In step 4, support vector machine is used to complete the recognition and classification of paint film color; the characteristic wavelength combination is used as the input feature, and the paint film color category is used as the output label; then, cross-validation and network search methods are used to optimize the hyperparameters of the SVM model, including kernel function type, kernel function parameters, and penalty coefficient; finally, the optimized SVM model is used to predict new paint film color samples to achieve automatic recognition and classification of paint film color.
Citation Information
Patent Citations
Method and system for recognizing vehicle body color in vehicle video image
CN101436252A
Hyperspectral image classification method and device based on spatial-spectral dimension filtering
CN111310571A
Intelligent detection method for hyperspectral image target
CN117496342A
Vehicle damage detection method based on hyperspectral imaging technology
CN117671381A
Vehicle image data processing method and device, equipment and storage medium
CN118196730A