Intelligent home lighting control method based on artificial intelligence
Through the intelligent home lighting control method based on artificial intelligence, compatibility issues between different brands and models of lamps and lighting effects problems in complex lighting environments are solved, uniform and comfortable lighting effects are achieved, and users' quality of life is improved.
Patent Information
- Application Number
- CN202411540215.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-04
AI Technical Summary
There are compatibility problems with lighting equipment of different brands and models, which makes it difficult to work together in smart home systems and it is difficult to achieve uniform and comfortable lighting effects in complex lighting environments.
Using intelligent home lighting control method based on artificial intelligence, a color restoration evaluation system is established by building a system architecture, and a parameter adjustment is used to realize automatic adjustment of lamp parameters to ensure uniformity and comfort of lighting effects.
It effectively solves the compatibility problem between different brands and models of lamps, achieves uniform and comfortable lighting effects in complex lighting environments, and improves users' quality of life.
Smart Images

Figure CN119562420A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart home lighting control, and in particular to a smart home lighting control method based on artificial intelligence. Background Art
[0002] Nowadays, the smart home market is booming and lighting equipment is flourishing. However, there are often compatibility issues between lighting equipment of different brands and models, which makes users face many challenges when building a smart home system. For example, different devices have different protocols, data formats, and control methods, which makes it difficult for them to work together and may even be incompatible. This compatibility issue not only increases the configuration difficulty of users, but also greatly affects the overall smart home experience; in addition, it faces the challenge of lighting effects in complex lighting environments. In modern homes, the lighting environment is often very complex. Users may mix and use multiple types of lamps in the same space, such as incandescent lamps, fluorescent lamps, LED lamps, etc., and these lamps may come from different brands. In this case, it becomes particularly difficult to achieve the ideal lighting effect. There are differences in light color, brightness, and color temperature of different lamps, resulting in uneven lighting effects in the entire space, and even color difference, glare and other problems, which not only affects visual comfort, but also may have an adverse effect on the health of users. Based on the above, the present application proposes a smart home lighting control method based on artificial intelligence. Summary of the invention
[0003] Based on the technical problems existing in the background technology, the present invention proposes an intelligent home lighting control method based on artificial intelligence.
[0004] The present invention proposes an artificial intelligence-based smart home lighting control method, comprising the following steps:
[0005] S1: Build system architecture: Its system architecture includes hardware layer, software layer and algorithm layer. The hardware layer includes input devices, control devices and communication devices. The software layer includes image acquisition module, feature extraction module, model training module, parameter optimization module and human-computer interaction module. The algorithm layer includes image processing algorithm, deep learning algorithm and optimization algorithm.
[0006] S2: Establish a color reproduction evaluation system: Scan or photograph the color card with high precision under standard light sources to obtain its calibration display effect, which will serve as the basis for subsequent evaluation and adjustment;
[0007] S3: Compare the display effects of lamps: collect the display images of lamps through the input device, and take the color card images under the illumination of the lamps under the same angle and lighting conditions, and pre-process the collected color card images through the image acquisition module, and then compare the processed images with the calibrated display effects in S2, convert the images from RGB color space to Lab color space, calculate the color difference, and finally quantify the color reproduction ability of the lamps;
[0008] S4: Use artificial intelligence algorithm to adjust parameters: The specific steps are as follows:
[0009] S401: Data collection and preprocessing: Use the image acquisition module to collect a large amount of lamp parameters and corresponding color display effect data, where the lamp parameters include color temperature and color coordinates, and clean and standardize the data to ensure data quality;
[0010] S402: Feature engineering: using a feature extraction module to extract features of lamp parameters and color display effects;
[0011] S403: Model selection and training: The model training module uses the training data set to train the decision tree model so that it learns the mapping relationship between the lamp parameters and the color display effect;
[0012] S404: Model evaluation and optimization: The parameter optimization module uses the validation data set to evaluate the model performance, uses the mean square error to calculate the error index, optimizes the model parameters based on the evaluation results, and improves the prediction accuracy of the model. The formula used is: Where n is the number of samples in the validation dataset; y i is the actual value of the (i)th sample; is the predicted value of the (i)th sample;
[0013] S405: Model prediction and feedback: Input the new color contrast analysis results into the model, predict the lamp parameters that need to be adjusted, and feed back the predicted parameters to the lamp control system in real time to achieve automatic adjustment of the lamp parameters;
[0014] S5: Achieve uniform and comfortable lighting effects: Combine the human eye visual model with user evaluation, comprehensively consider the human visual system's perception of brightness, color, contrast and light distribution, and automatically adjust the parameters of lighting brightness, color and direction by sensing user needs and environmental changes to ensure that users can feel comfortable lighting effects in different time periods and usage scenarios.
[0015] Preferably, in S1, the input device is a high-resolution input device for collecting color card images, the control device uses an artificial intelligence neural network algorithm to process and analyze the data collected by the input device to generate corresponding lighting solutions or optimization suggestions, and the communication device is used for data transmission between hardware devices to achieve data transmission and ensure the real-time and linkage of the system;
[0016] The image acquisition module is responsible for controlling the camera to acquire the color card image and preprocessing the image, such as denoising and cropping. The feature extraction module is used to extract color features from the image, such as the RGB value and HSV value of the color block. The model training module uses the labeled data set to train the deep learning model and establish the mapping relationship between the color features and the lamp parameters. The parameter optimization module is used to optimize the lamp parameters according to the prediction results of the model so that the display effect is consistent with the color card. The human-computer interaction module is used to provide a friendly user interface to facilitate users to set up and control the system.
[0017] The image processing algorithms include image segmentation, color space conversion and noise removal algorithms; the deep learning algorithms include convolutional neural networks (CNN) and recurrent neural networks (RNN) for establishing a nonlinear mapping relationship between color features and lamp parameters; the optimization algorithms include gradient descent and genetic algorithms for optimizing lamp parameters so that their display effects are close to those of the color card.
[0018] Preferably, in S3, when the image acquisition module pre-processes the acquired color card image, a Gaussian filter and a median filter are used to smooth the image and reduce noise, wherein the application formula of the Gaussian filter is as follows:
[0019]
[0020] Where G(x,y) represents the weight value of the Gaussian filter at the coordinate (x,y) in the image; σ represents the standard deviation of the Gaussian distribution, which controls the width of the Gaussian filter. The larger the standard deviation, the stronger the filtering effect and the higher the blur; x and y represent the horizontal and vertical distances relative to the center of the Gaussian filter. Usually, the center of the Gaussian filter is the origin (0, 0), so x and y represent the offset from the center point to the current point; 2πσ 2 is the normalization constant of the Gaussian function, ensuring that the sum of the weights of the entire Gaussian filter is 1 and that the brightness of the image is not changed; is the exponential part of the Gaussian function, indicating that the Gaussian filter weight is attenuated according to the distance from the point (x, y) to the center of the Gaussian filter;
[0021] The median filter reduces the noise in the image by replacing each pixel value in the image with the median value of all pixel values in the neighborhood of the pixel while retaining edge details, and then uses the grayscale world assumption that the average color in the image should be neutral gray, and achieves white balance by adjusting the color components of the image, and finally uses histogram equalization to enhance the contrast of the image and make the colors more vivid.
[0022] Preferably, in said S3, when converting the image from the RGB color space to the Lab color space, firstly, the RGB value is converted into an XYZ value, and then the XYZ value is converted into a Lab value;
[0023] The conversion process from RGB to XYZ is as follows:
[0024] (1) RGB color values are usually expressed in the range of 0 to 255. The RGB values are standardized to the range of [0,1] for subsequent operations, where: R represents the component of the red channel (Red), which usually ranges from 0 to 255, G represents the component of the green channel (Green), which usually ranges from 0 to 255, and B represents the component of the blue channel (Blue), which usually ranges from 0 to 255;
[0025] (2) Perform gamma correction to adjust the brightness perception of the RGB value so that the color conversion is more consistent with the human eye's perception of light. The formula used for correction is as follows:
[0026]
[0027] Among them, R, G, and B represent the color components of the red, green, and blue channels, but their values have been standardized to the range of [0,1]. 0.04045, 0.055, 1.055, 2.4, and 12.92 are constants used in the gamma correction process to adjust the RGB color nonlinearly to meet the photosensitive curve characteristics of the human eye.
[0028] (3) Convert to CIE 1931XYZ values using the following formula:
[0029] X=R*0.4112+G*0.3576+B*0.1805;
[0030] Y=R*0.2126+G*0.7152+B*0.0722;
[0031] Z=R*0.0193+G*0.1192+B*0.9505
[0032] Where X represents the X component in the CIE 1931XYZ color space, which mainly corresponds to the brightness components of red and green; Y represents the Y component in the CIE 1931XYZ color space, which mainly corresponds to the brightness of green, and the Y value has a strong correlation with the brightness perception; Z represents the Z component in the CIE 1931XYZ color space, which mainly corresponds to the brightness components of blue and green; 0.4124, 0.3576 and 0.1805 are coefficients used to convert the colors of the red, green and blue channels into the XYZ color space; 0.2126, 0.7152 and 0.0722 correspond to the sensitivity of the human eye to green, red and blue, and are mainly used for the calculation of the Y component;
[0033] 0.0193, 0.1192, and 0.9505 are used for the conversion of the Z component, reflecting the conversion relationship between colors in different channels;
[0034] The conversion process from XYZ to Lab is as follows:
[0035] (1) Normalize the XYZ value and divide it by the corresponding white point reference value. The formula used is: Among them, 95.047, 100.0 and 108.88 are the reference values of the D65 white point, which are used to standardize the XYZ values so that the converted Lab color values are consistent;
[0036] (2) Calculate the Lab value, the formula is as follows:
[0037] L * =116×f(Y)-16;
[0038] a * =500×(f(X)-f(Y));
[0039] b * =200×(f(Y)-f(Z))
[0040] Where L represents brightness, L * Represents the L component in the Lab color space, which indicates the brightness of the color. The range is 0 to 100. The higher the value, the brighter the color. * Indicates the red-green axis value of the color. If a * A positive value indicates a reddish color; if a * A negative value indicates a greenish color; b * Indicates the blue-yellow axis value of the color. If b * A positive value indicates a yellowish color; if b * Negative values indicate a bluish color.
[0041] Preferably, in S3, the color difference of each color sample is calculated using a ΔE formula, which is:
[0042] Where L 1 、a 1 and b 1 is the Lab value of the reference color, L 2 、a 2 and b 2 It is the Lab value of the test color. The smaller the ΔE value, the higher the color reproduction.
[0043] Preferably, in S3, when quantifying the color reproduction ability of the lamp, it is necessary to calculate the average ΔE value of all color samples, and evaluate the color reproduction ability of the lamp based on the average ΔE value. The ΔE values of all color samples are added together and then divided by the number of color samples. The formula is: average Where n is the number of color samples, ΔEi is the ΔE value of the i-th color sample, and the smaller the average ΔE value, the better the color reproduction ability of the lamp.
[0044] Preferably, in S401, data cleaning specifically includes processing missing values and outliers to ensure data integrity, while removing duplicate data and reducing redundancy; data standardization specifically includes converting data of different dimensions to the same scale to facilitate subsequent analysis, and using Z-score standardization to process data. The Z-score standardization formula is: Where Z is the normalized value, X is the original data value, μ is the mean of the data, and σ is the standard deviation of the data.
[0045] Preferably, in S403, the decision tree model is used for classification and regression tasks, which recursively divides the data set into smaller subsets until the data points in each subset have similar features. The specific steps of running the decision tree model are:
[0046] S4031: Calculate the entropy of the data set: where p i is the probability of category i in data set D;
[0047] S4032: Calculate the entropy of each attribute: For each lamp parameter, calculate the entropy of the data subset under all possible values. The formula is: where p i,v is the category i in the data subset D v The probability of
[0048] S4033: For each lamp parameter, calculate its information gain, the formula is: Where Values(A) is all possible values of attribute A, |D| is the size of data set D, and |Dv| is the size of data subset Dv;
[0049] S4034: Select the best split point: compare the information gain of all lamp parameters and select the parameter with the largest information gain as the split point.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The present invention obtains the actual display effect of the lamp through a camera, uses artificial intelligence technology to analyze and process the obtained image data, and uses an artificial intelligence algorithm to adjust the parameters of the lamp in real time, thereby realizing fine adjustment of the lamp to make its display effect consistent with the calibrated display effect. It can not only effectively solve the compatibility problems between lamps of different brands and models, but also can achieve uniform and comfortable lighting effects in complex and changeable lighting environments, so that users can enjoy a more comfortable and pleasant lighting environment and improve their quality of life. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A block diagram of an intelligent home lighting control method based on artificial intelligence proposed by the present invention;
[0053] Figure 2 The present invention provides a flowchart of an intelligent home lighting control method based on artificial intelligence. DETAILED DESCRIPTION
[0054] The present invention will be further explained below in conjunction with specific embodiments.
[0055] Example
[0056] Reference Figure 1-2 This embodiment proposes an intelligent home lighting control method based on artificial intelligence, comprising the following steps:
[0057] S1: Build system architecture: Its system architecture includes hardware layer, software layer and algorithm layer. The hardware layer includes input devices, control devices and communication devices. The software layer includes image acquisition module, feature extraction module, model training module, parameter optimization module and human-computer interaction module. The algorithm layer includes image processing algorithm, deep learning algorithm and optimization algorithm.
[0058] The input device is a high-resolution input device used to collect color card images. The control device uses an artificial intelligence neural network algorithm to process and analyze the data collected by the input device to generate corresponding lighting solutions or optimization suggestions. The communication device is used for data transmission between hardware devices to achieve data transmission and ensure the real-time and linkage of the system.
[0059] The image acquisition module is responsible for controlling the camera to collect the color card image and preprocessing the image, such as denoising and cropping. The feature extraction module is used to extract color features from the image, such as the RGB value and HSV value of the color block. The model training module uses the labeled data set to train the deep learning model and establish the mapping relationship between color features and lamp parameters. The parameter optimization module is used to optimize the lamp parameters according to the prediction results of the model so that its display effect is consistent with the color card. The human-computer interaction module is used to provide a friendly user interface to facilitate users to set up and control the system.
[0060] Image processing algorithms include image segmentation, color space conversion and noise removal algorithms. Deep learning algorithms include convolutional neural networks (CNN) and recurrent neural networks (RNN) to establish nonlinear mapping relationships between color features and lamp parameters. Optimization algorithms include gradient descent and genetic algorithms to optimize lamp parameters to make their display effects close to those of the color card.
[0061] S2: Establish a color reproduction evaluation system: Scan or photograph the color card with high precision under standard light sources to obtain its calibration display effect, which will serve as the basis for subsequent evaluation and adjustment;
[0062] S3: Compare the display effects of lamps: collect the display images of lamps through the input device, and take the color card images under the illumination of the lamps under the same angle and lighting conditions, and pre-process the collected color card images through the image acquisition module, and then compare the processed images with the calibrated display effects in S2, convert the images from RGB color space to Lab color space, calculate the color difference, and finally quantify the color reproduction ability of the lamps;
[0063] When the image acquisition module pre-processes the acquired color card image, it uses Gaussian filter and median filter to smooth the image and reduce noise. The application formula of Gaussian filter is as follows:
[0064]
[0065] Where G(x,y) represents the weight value of the Gaussian filter at the coordinate (x,y) in the image; σ represents the standard deviation of the Gaussian distribution, which controls the width of the Gaussian filter. The larger the standard deviation, the stronger the filtering effect and the higher the blur; x and y represent the horizontal and vertical distances relative to the center of the Gaussian filter. Usually, the center of the Gaussian filter is the origin (0, 0), so x and y represent the offset from the center point to the current point; 2πσ 2 is the normalization constant of the Gaussian function, ensuring that the sum of the weights of the entire Gaussian filter is 1 and that the brightness of the image is not changed; is the exponential part of the Gaussian function, indicating that the Gaussian filter weight is attenuated according to the distance from the point (x, y) to the center of the Gaussian filter;
[0066] The median filter reduces the noise in the image by replacing each pixel value in the image with the median value of all pixel values in the neighborhood of the pixel, while retaining edge details. Then, through the grayscale world assumption, it is assumed that the average color in the image should be a neutral gray, and white balance is achieved by adjusting the color components of the image. Finally, histogram equalization is used to enhance the contrast of the image and make the colors more vivid.
[0067] When converting an image from RGB color space to Lab color space, first convert the RGB values to XYZ values, and then convert the XYZ values to Lab values;
[0068] Among them, RGB color space is a color representation method based on light, which mainly generates various colors by mixing the three primary colors of red, green and blue; XYZ color space is a standard color model based on human visual perception, which represents color by three components: X represents the component close to red, Y represents the component close to green (at the same time, the Y component is related to brightness), and Z represents the component close to blue; Lab color space is another color representation method based on human visual perception. It is a device-independent color model with a uniformly perceived color space, which is closer to the human eye's perception of color. L (Lightness) represents the brightness or lightness of the color, a (green-red component) represents the change of color from green to red, and b (blue-yellow component) represents the change of color from blue to yellow;
[0069] The conversion process from RGB to XYZ is as follows:
[0070] (1) RGB color values are usually expressed in the range of 0 to 255. The RGB values are standardized to the range of [0,1] for subsequent operations, where: R represents the component of the red channel (Red), which usually ranges from 0 to 255, G represents the component of the green channel (Green), which usually ranges from 0 to 255, and B represents the component of the blue channel (Blue), which usually ranges from 0 to 255;
[0071] (2) Perform gamma correction to adjust the brightness perception of the RGB value so that the color conversion is more consistent with the human eye's perception of light. If the RGB value is greater than 0.04045, the gamma correction formula is used. If it is less than or equal to this value, it is directly linearly scaled. The formula used for correction is as follows:
[0072]
[0073] Among them, R, G, and B represent the color components of the red, green, and blue channels, but their values have been standardized to the range of [0,1]. 0.04045, 0.055, 1.055, 2.4, and 12.92 are constants used in the gamma correction process to adjust the RGB color nonlinearly to meet the photosensitive curve characteristics of the human eye.
[0074] (3) Convert to CIE 1931XYZ values using the following formula:
[0075] X=R*0.4112+G*0.3576+B*0.1805;
[0076] Y=R*0.2126+G*0.7152+B*0.0722;
[0077] Z=R*0.0193+G*0.1192+B*0.9505
[0078] Where X represents the X component in the CIE 1931XYZ color space, which mainly corresponds to the brightness components of red and green; Y represents the Y component in the CIE 1931XYZ color space, which mainly corresponds to the brightness of green, and the Y value has a strong correlation with the brightness perception; Z represents the Z component in the CIE 1931XYZ color space, which mainly corresponds to the brightness components of blue and green; 0.4124, 0.3576 and 0.1805 are coefficients used to convert the colors of the red, green and blue channels into the XYZ color space; 0.2126, 0.7152 and 0.0722 correspond to the sensitivity of the human eye to green, red and blue, and are mainly used for the calculation of the Y component;
[0079] 0.0193, 0.1192, and 0.9505 are used for the conversion of the Z component, reflecting the conversion relationship between colors in different channels;
[0080] The conversion process from XYZ to Lab is as follows:
[0081] (1) Normalize the XYZ value and divide it by the corresponding white point reference value. The formula used is: Among them, 95.047, 100.0 and 108.88 are the reference values of the D65 white point, which are used to standardize the XYZ values so that the converted Lab color values are consistent;
[0082] (2) Calculate the Lab value, the formula is as follows:
[0083] L * =116×f(Y)-16;
[0084] a *=500×(f(X)-f(Y));
[0085] b * =200×(f(Y)-f(Z))
[0086] Where L represents brightness, L * Represents the L component in the Lab color space, which indicates the brightness of the color. The range is 0 to 100. The higher the value, the brighter the color. * Indicates the red-green axis value of the color. If a * A positive value indicates a reddish color; if a * A negative value indicates a greenish color; b * Indicates the blue-yellow axis value of the color. If b * A positive value indicates a yellowish color; if b * A negative value indicates a bluish color;
[0087] In addition, the nonlinear part of the XYZ value needs to be adjusted during the conversion process to ensure the accuracy of the color conversion. The formula used is:
[0088]
[0089] Where f(t) indicates that the function is used to process the nonlinear part of XYZ color. When t>0.008856t>0.008856t>0.008856, the cube root is used, otherwise the linear formula is used for adjustment; 0.008856, 7.787 and It is a constant in the conversion function, used for nonlinear adjustment to ensure that the converted color conforms to the perceptual characteristics of the Lab space;
[0090] The color difference of each color sample is calculated using the ΔE formula, which is:
[0091] Where L 1 、a 1 and b 1 is the Lab value of the reference color, L 2 、a 2 and b 2 It is the Lab value of the test color. The smaller the ΔE value, the higher the color reproduction degree.
[0092] To quantify the color reproduction ability of a lamp, it is necessary to calculate the average ΔE value of all color samples. To evaluate the color reproduction ability of a lamp based on the average ΔE value, add the ΔE values of all color samples and then divide by the number of color samples. The formula is: Average Where n is the number of color samples, ΔEi is the ΔE value of the i-th color sample, and the smaller the average ΔE value, the better the color reproduction ability of the lamp;
[0093] S4: Use artificial intelligence algorithm to adjust parameters: The specific steps are as follows:
[0094] S401: Data collection and preprocessing: Use the image acquisition module to collect a large amount of lamp parameters and corresponding color display effect data, where the lamp parameters include color temperature and color coordinates, and clean and standardize the data to ensure data quality. Data cleaning specifically processes missing values and outliers to ensure data integrity, removes duplicate data, and reduces redundancy; data standardization specifically converts data of different dimensions to the same scale for subsequent analysis, and uses Z-score standardization to process data. The Z-score standardization formula is: Where Z is the standardized value, X is the original data value, μ is the mean of the data, and σ is the standard deviation of the data;
[0095] S402: Feature engineering: using a feature extraction module to extract features of lamp parameters and color display effects;
[0096] S403: Model selection and training: The model training module uses the training data set to train the decision tree model so that it learns the mapping relationship between the lamp parameters and the color display effect;
[0097] The decision tree model is used for classification and regression tasks. It recursively divides the data set into smaller subsets until the data points in each subset have similar characteristics. The specific steps of running the decision tree model are:
[0098] S4031: Calculate the entropy of the data set: where p i is the probability of category i in data set D;
[0099] S4032: Calculate the entropy of each attribute: For each lamp parameter, calculate the entropy of the data subset under all possible values. The formula is: where p i,v is the category i in the data subset D v The probability of
[0100] S4033: For each lamp parameter, calculate its information gain, the formula is: Where Values(A) is all possible values of attribute A, |D| is the size of data set D, and |Dv| is the size of data subset Dv;
[0101] S4034: Select the best split point: compare the information gain of all lamp parameters and select the parameter with the largest information gain as the split point;
[0102] S404: Model evaluation and optimization: The parameter optimization module uses the validation data set to evaluate the model performance, uses the mean square error to calculate the error index, optimizes the model parameters based on the evaluation results, and improves the prediction accuracy of the model. The formula used is: Where n is the number of samples in the validation dataset; y i is the actual value of the (i)th sample; is the predicted value of the (i)th sample;
[0103] S405: Model prediction and feedback: Input the new color contrast analysis results into the model, predict the lamp parameters that need to be adjusted, and feed back the predicted parameters to the lamp control system in real time to achieve automatic adjustment of the lamp parameters;
[0104] S5: Achieve uniform and comfortable lighting effects: Combine the human eye visual model with user evaluation, comprehensively consider the human visual system's perception of brightness, color, contrast and light distribution, and automatically adjust the parameters of lighting brightness, color and direction by sensing user needs and environmental changes to ensure that users can feel comfortable lighting effects in different time periods and usage scenarios;
[0105] This embodiment obtains the actual display effect of the lamp through the camera, uses artificial intelligence technology to analyze and process the obtained image data, and uses artificial intelligence algorithm to adjust the parameters of the lamp in real time, so as to achieve fine adjustment of the lamp and make its display effect consistent with the calibrated display effect. It can not only effectively solve the compatibility problems between lamps of different brands and models, but also achieve uniform and comfortable lighting effects in complex and changeable lighting environments, so that users can enjoy a more comfortable and pleasant lighting environment and improve their quality of life.
[0106] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A smart home lighting control method based on artificial intelligence, characterized in that: The following steps are involved: S1: Build system architecture: Its system architecture includes hardware layer, software layer and algorithm layer. The hardware layer includes input devices, control devices and communication devices. The software layer includes image acquisition module, feature extraction module, model training module, parameter optimization module and human-computer interaction module. The algorithm layer includes image processing algorithm, deep learning algorithm and optimization algorithm. S2: Establish a color reproduction evaluation system: Scan or photograph the color card with high precision under standard light sources to obtain its calibration display effect, which will serve as the basis for subsequent evaluation and adjustment; S3: Compare the display effects of lamps: collect the display images of lamps through the input device, and take the color card images under the illumination of the lamps under the same angle and lighting conditions, and pre-process the collected color card images through the image acquisition module, and then compare the processed images with the calibrated display effects in S2, convert the images from RGB color space to Lab color space, calculate the color difference, and finally quantify the color reproduction ability of the lamps; S4: Use artificial intelligence algorithm to adjust parameters: The specific steps are as follows: S401: Data collection and preprocessing: Use the image acquisition module to collect a large amount of lamp parameters and corresponding color display effect data, where the lamp parameters include color temperature and color coordinates, and clean and standardize the data to ensure data quality; S402: Feature engineering: using a feature extraction module to extract features of lamp parameters and color display effects; S403: Model selection and training: The model training module uses the training data set to train the decision tree model so that it learns the mapping relationship between the lamp parameters and the color display effect; S404: Model evaluation and optimization: The parameter optimization module uses the validation data set to evaluate the model performance, uses the mean square error to calculate the error index, optimizes the model parameters based on the evaluation results, and improves the prediction accuracy of the model. The formula used is: Where n is the number of samples in the validation dataset; y i is the actual value of the (i)th sample; is the predicted value of the (i)th sample; S405: Model prediction and feedback: Input the new color contrast analysis results into the model, predict the lamp parameters that need to be adjusted, and feed back the predicted parameters to the lamp control system in real time to achieve automatic adjustment of the lamp parameters; S5: Achieve uniform and comfortable lighting effects: Combine the human eye visual model with user evaluation, comprehensively consider the human visual system's perception of brightness, color, contrast and light distribution, and automatically adjust the parameters of lighting brightness, color and direction by sensing user needs and environmental changes to ensure that users can feel comfortable lighting effects in different time periods and usage scenarios.
2. The method for controlling smart home lighting based on artificial intelligence according to claim 1, characterized in that: In S1, the input device is a high-resolution input device for collecting color card images, the control device uses an artificial intelligence neural network algorithm to process and analyze the data collected by the input device to generate corresponding lighting solutions or optimization suggestions, and the communication device is used for data transmission between hardware devices to achieve data transmission and ensure the real-time and linkage of the system; The image acquisition module is responsible for controlling the camera to acquire the color card image and preprocessing the image. The feature extraction module is used to extract color features from the image. The model training module uses the labeled data set to train the deep learning model and establish the mapping relationship between color features and lamp parameters. The parameter optimization module is used to optimize the lamp parameters according to the prediction results of the model so that the display effect is consistent with the color card. The human-computer interaction module is used to provide a friendly user interface to facilitate users to set up and control the system. The image processing algorithms include image segmentation, color space conversion and noise removal algorithms; the deep learning algorithms include convolutional neural networks (CNN) and recurrent neural networks (RNN) for establishing a nonlinear mapping relationship between color features and lamp parameters; the optimization algorithms include gradient descent and genetic algorithms for optimizing lamp parameters so that their display effects are close to those of the color card.
3. The method for controlling smart home lighting based on artificial intelligence according to claim 1, characterized in that: In S3, when the image acquisition module pre-processes the acquired color card image, it smoothes the image through a Gaussian filter and a median filter to reduce noise, wherein the application formula of the Gaussian filter is as follows: Where G(x,y) represents the weight value of the Gaussian filter at the coordinate (x,y) in the image; σ represents the standard deviation of the Gaussian distribution, which controls the width of the Gaussian filter. The larger the standard deviation, the stronger the filtering effect and the higher the blur; x and y represent the horizontal and vertical distances relative to the center of the Gaussian filter. Usually, the center of the Gaussian filter is the origin (0, 0), so x and y represent the offset from the center point to the current point; 2πσ 2 is the normalization constant of the Gaussian function, ensuring that the sum of the weights of the entire Gaussian filter is 1 and that the brightness of the image is not changed; is the exponential part of the Gaussian function, indicating that the Gaussian filter weight is attenuated according to the distance from the point (x, y) to the center of the Gaussian filter; The median filter reduces the noise in the image by replacing each pixel value in the image with the median value of all pixel values in the neighborhood of the pixel while retaining edge details, and then uses the grayscale world assumption that the average color in the image should be neutral gray, and achieves white balance by adjusting the color components of the image, and finally uses histogram equalization to enhance the contrast of the image and make the colors more vivid.
4. The method for controlling smart home lighting based on artificial intelligence according to claim 1, characterized in that: In S3, when converting the image from the RGB color space to the Lab color space, the RGB value is first converted to the XYZ value, and then the XYZ value is converted to the Lab value; The conversion process from RGB to XYZ is as follows: (1) RGB color values are usually expressed in the range of 0 to 255. The RGB values are standardized to the range of [0,1] for subsequent operations, where: R represents the component of the red channel (Red), which usually ranges from 0 to 255, G represents the component of the green channel (Green), which usually ranges from 0 to 255, and B represents the component of the blue channel (Blue), which usually ranges from 0 to 255; (2) Perform gamma correction to adjust the brightness perception of the RGB value so that the color conversion is more consistent with the human eye's perception of light. The formula used for correction is as follows: Among them, R, G, and B represent the color components of the red, green, and blue channels, but their values have been standardized to the range of [0,1]. 0.04045, 0.055, 1.055, 2.4, and 12.92 are constants used in the gamma correction process to adjust the RGB color nonlinearly to meet the photosensitive curve characteristics of the human eye. (3) Convert to CIE 1931 XYZ values using the following formula: X=R*0.4112+G*0.3576+B*0.1805; Y=R*0.2126+G*0.7152+B*0.0722; Z=R*0.0193+G*0.1192+B*0.9505 Where X represents the X component in the CIE 1931 XYZ color space, which mainly corresponds to the brightness components of red and green; Y represents the Y component in the CIE 1931 XYZ color space, which mainly corresponds to the brightness of green, and the Y value has a strong correlation with the brightness perception; Z represents the Z component in the CIE 1931 XYZ color space, which mainly corresponds to the brightness components of blue and green; 0.4124, 0.3576 and 0.1805 are coefficients used to convert the colors of the red, green and blue channels into the XYZ color space; 0.2126, 0.7152 and 0.0722 correspond to the sensitivity of the human eye to green, red and blue, and are mainly used for the calculation of the Y component; 0.0193, 0.1192 and 0.9505 are used for the conversion of the Z component, reflecting the conversion relationship between colors in different channels; The conversion process from XYZ to Lab is as follows: (1) Normalize the XYZ value and divide it by the corresponding white point reference value. The formula used is: Among them, 95.047, 100.0 and 108.88 are the reference values of the D65 white point, which are used to standardize the XYZ values so that the converted Lab color values are consistent; (2) Calculate the Lab value, the formula is as follows: L * =116×f(Y)-16; a * =500×(f(X)-f(Y)); b * =200×(f(Y)-f(Z)) Where L represents brightness, L * Represents the L component in the Lab color space, which indicates the brightness of the color. The range is 0 to 100. The higher the value, the brighter the color. * Indicates the red-green axis value of the color, a * A positive value indicates a reddish color; a * A negative value indicates a greenish color; b * Indicates the blue-yellow axis value of the color, b * A positive value indicates a yellowish color; b * Negative values indicate a bluish color.
5. The method for controlling lighting in a smart home based on artificial intelligence according to claim 1, characterized in that: In S3, the color difference of each color sample is calculated using the ΔE formula, which is: Among them, L1, a1 and b1 are the Lab values of the reference color, L2, a2 and b2 are the Lab values of the test color, and the smaller the ΔE value, the higher the color reproduction.
6. The method for controlling lighting in a smart home based on artificial intelligence according to claim 5, characterized in that: In S3, when quantifying the color reproduction ability of the lamp, it is necessary to calculate the average ΔE value of all color samples. The color reproduction ability of the lamp is evaluated based on the average ΔE value. The ΔE values of all color samples are added together and then divided by the number of color samples. The formula is: Average Where n is the number of color samples, ΔEi is the ΔE value of the i-th color sample, and the smaller the average ΔE value, the better the color reproduction ability of the lamp.
7. The method for controlling lighting in a smart home based on artificial intelligence according to claim 1, characterized in that: In S401, data cleaning specifically includes processing missing values and outliers to ensure data integrity, while removing duplicate data and reducing redundancy; data standardization specifically includes converting data of different dimensions to the same scale to facilitate subsequent analysis, and using Z-score standardization to process data. The Z-score standardization formula is: Where Z is the normalized value, X is the original data value, μ is the mean of the data, and σ is the standard deviation of the data.
8. The method for controlling lighting in a smart home based on artificial intelligence according to claim 1, characterized in that: In S403, the decision tree model is used for classification and regression tasks. It recursively divides the data set into smaller subsets until the data points in each subset have similar features. The specific steps of running the decision tree model are: S4031: Calculate the entropy of the data set: where p i is the probability of category i in data set D; S4032: Calculate the entropy of each attribute: For each lamp parameter, calculate the entropy of the data subset under all possible values. The formula is: where p i,v is the category i in the data subset D v The probability of S4033: For each lamp parameter, calculate its information gain, the formula is: Where Values(A) is all possible values of attribute A, |D| is the size of data set D, and |Dv| is the size of data subset Dv; S4034: Select the best split point: compare the information gain of all lamp parameters and select the parameter with the largest information gain as the split point.