Open Access

ARTICLE

# Intelligent Color Reasoning of IOT Based on P-laws

1 School of Information Engineering, San Ming University, Sanming, 365004, China

2 School of Mathematics and Statistics, University College Dublin, Dublin, Dublin 4, Ireland

* Corresponding Author: Ning Cao. Email:

*Computer Systems Science and Engineering* **2023**, *45*(3), 3181-3193. https://doi.org/10.32604/csse.2023.030985

**Received** 07 April 2022; **Accepted** 09 June 2022; **Issue published** 21 December 2022

## Abstract

Aiming at the dynamics and uncertainties of natural colors affected by the natural environment, a color*P*-law generation model based on the natural environment is proposed to develop algorithms and to provide a theoretical basis for plant dynamic color simulation and color sensor data transmission. Based on the HSL (Hue, Saturation, Lightness) color solid, the proposed method uses the function

*P*-set to provide a color

*P*-law generation model and an algorithm of the Dynamic Colors System (DCS), establishing the DCS modeling theory of the natural environment and the color

*P*-reasoning simulation based on the HSL color solid. The experimental results show that based on the color

*P*-law, for the DCS of the natural environment, when the external factors change, the color of the plant changes, accordingly, verifying the effectiveness of the color

*P*-law generation model and the algorithm of the DCS. In the dynamic color intelligent simulation system, when external factors change, the dynamic change of plant color generally conforms to the basic laws of the natural environment. This enables the effective extraction of color data from the Internet of Things (IoT)-based color sensors and provides an effective way to significantly reduce the data transmission bandwidth of the IoT network.

## Keywords

Color is the outcome of a visual perception of light reflected by objects on the human brain and visual organs. Color comes from nature. Due to the natural factors of color, color has an important influence on people’s mental state or mood. The most beautiful and harmonious color matching comes from nature. The color matching information extracted from the natural landscape has its unique vitality and beauty. This information facilitates color sensors based on the Internet of Things (IoT) to understand how to rapidly optimize the settings of color parameters and apply them to products and systems [1–3]. One leaf knows autumn (from the fall of a leaf, we know the arrival of autumn). We can explore the variation law of the natural color of a certain type of plant from the color variation of this type of plant. With the changing of the four seasons, plants will show different colors as the seasons change. Each type of plant has its own life. From the birth of plants to vibrant colors, and to gradual decay, plants are telling its story. The color variation of plants shows the color flow of nature in the four seasons.

Currently the most widely used color standards are: 1) Munsell color system established by the National Bureau of Standards (NBS) ; 2) the Natural Color System (NCS) is the Swedish national color standard; 3) German RAL color system; 4) CIE-XYZ (Commission Internationale de L’ Eclairage-XYZ); 5) RGB color stereo; 6) Adobe RGB color solid; 6) other color solid: such as HSI (Hue, Saturation, Intensity) cylindrical color solid, HSI spherical color solid, Lab color solid [4]. The basis of color digitization is to create a three-dimensional digital model of color. In this paper, it’s called color solid, which is a three-dimensional representation of color space, being an analog the two-dimensional representa-tion of the color wheel. The added spatial dimension allows a color solid to depict an additional dimension of color variation.

This paper sets the color defined by the (H, S, L) value in the HSL space, where 00 ≤ H < 3600, 0 ≤ S, L ≤ 1. While (R, G, B) in RGB space, where 0 ≤ R, G, B≤ 1.

Color digitization is to obtain hue (red, green, blue, etc.), lightness (light and shade), and saturation (or chroma) from the natural color through the color sensor, which makes a color solid can show all possible colors in the three-dimensional structure.

In the natural environment, the color of plants is mostly affected by changes in environmental factors. Genetic factors of plants are the internal cause of plant color formation, whereas plant photosynthesis, water metabolism, mineral metabolism and other processes are often affected by light, temperature, humidity, and other external factors, causing changes in the proportion of various pigments in plants, resulting in the manifestation of different colors [5–7].

In recent years, color digital simulation based on a natural environment has been applied in the IoT devices. The proposed approaches of color digital simulation are mainly divided into 1) the texture model based on optical characteristics and the time-varying model based on physical authenticity [8–13]; 2) Algorithm based on environmental factors [14–19]; 3) the research on simulation algorithms in large scenarios, etc. [20].

The study [14,18] which apply the Markov chain algorithm takes the external environment and seasonal factors of plants into consideration, and the simulation effect has strong physical authenticity. However, the simulation is static, and the color effect is also static color simulation, which cannot be changed in real-time with changes in external environmental factors such as temperature and light. Nevertheless, in practice, the data collected in real scenes is uncertain and large, causing difficulty in smoothly transmitting in the network formed by the IoT devices.

This naturally raises a question. In the natural environment, can we study the regularity of external uncertain factors such as light intensity, temperature, and humidity that affect the color of plants, and obtain the color variation law of plants through reasoning?

This paper analyzes the influence of external uncertain factors on the color of plants and uses the function P-set [21] to propose a color reasoning algorithm based on the P-law in a natural environment. When external factors change, the color of plants also changes accordingly. Then, the changed results are recorded by IoT sensors to achieve the optimization of plant color parameter settings through reasoning. To model the dynamic color system of plants based on the natural environment, it aims to develop an algorithm and provide a theoretical basis for the dynamic simulation of natural color of plants for the IoT devices.

2 The Color P-law of the Dynamic Color System

If the color variation process is abstracted into a Dynamic Colors System which is called D. Apparently since the Dynamic Color System D is affected or interfered by some dynamic and uncertain external factors in the natural environment. These factors are all in the set

The color variation law set of a Dynamic Colors System D is U(x), which we call the Universe of Color law having

In fact, if the relationship and characteristics between the distribution law of D’s external factor change and D’s color distribution law can be obtained, the color variation law of D can also be obtained by reasoning.

Function P-sets (Function Packet Sets) is a new mathematical structure, which has dynamic and uncertainty. It has achieved promising results in the application of dynamic system law mining, dynamic law discovery and Pattern dynamic recognition [14,16–18,20–28]. Function P-sets have dynamic characteristics and law characteristics, which is suitable for solving the problem of uncertain law with a dynamic system.

This paper utilizes approaches provided by the literature [4,21,29,30] to present the concept of the color P-law, the generation color P-law and the color P-reasoning of Dynamic Colors System D. We present a Dynamic Color System D in a natural environment, an intelligent color reasoning algorithm based on the P-law, aiming to provide a theoretical basis for the dynamic color processing of the IoT sensors in the natural environment.

Convention: Let U(x) be a color law (function) finite domain and

Definition 1. Given the color law set

where

if the attribute set of

Definition 2. Given color law set

if the attribute set

Definition 3. The color-law set pair formed by

Based on Definitions 1-3, the color P-law characteristics based on the natural environment is put forward.

2.2 The Characteristics of Color P-law

Based on Definition 1, the attribute set

Theorem 1. Color law Interference Chain Reasoning Theorem

Given the color law set

From Eqs. (10) and (11), corollary 1 can be directly obtained:

Corollary 1. If the existence of the color P-law set depends on the interference (supplement or deletion) of the attribute set of the color-law set S, then there is

where any

Apparently, when

Corollary 2. Color law S and color P-law set

Based on Definitions 1–3, Theorem 1 and Corollary 1, a color P-law generation model can be given.

3 Color P-law Generation Model

Given the color law set

3.1 The Color P-law Generation Algorithm

(1) Discretization of the Color Law

Discretized form of color law

(2) Discrete Form Generation of the Color Law Set

Based on Eq. (14), the discrete form of the color law set

(3) The Law Generation of the Color Law Set S

Eq. (17) is the k-th order mean difference of

Apparently, the attribute set

Definition 4. Let

(1)

(2)

(3)

The curve of the color P-external law

3.2 Dynamic Characteristic of Color P-law Generation Algorithm

Definition 5. Let

(1)

(2)

(3)

Obviously, definition 5 reveals the dynamic change degree of the P-external law set

Theorem 2. Given the color law set S and the attribute set

Proof: If

According to definition 5, (24) and (25), there is

If

3.3 The Interconversion between Color Spaces

Without loss of generality, only the conversion between RGB space and HSL space is discussed here [31].

(1)RGB to HSL Color Conversion

The R, G, B values are divided by 255 to change the range from [0, 255] to [0, 1], respectively. To make our definitions easier to write, we’ll define:

And Hue, Saturation and Lightness calculation:

(2) HSL to RGB Color Conversion

Given a color with hue

In many situations, the central limit theorem (CLT) establishes that the sum of many independent, additive effects is approximately normally distributed, even if the original variables themselves are not normally distributed.

Theorem 3. (Central Limit Theorem [31]) If

4 Color P-law Reasoning Simulation

Various colors in nature can be applied to color sensors to obtain (H, S, L) digital values in the HSL space, which is a one-to-one mapping to the positions in the color three-dimensional space. Each color can be represented by a digital quantity. The digitization of the color enables a more accurate and convenient color management, the order chain in HSL color space is shown in Fig. 1. The value of hue in HSL space, which satisfies

In simulation experiments, when the external color factors of simulated plants in the natural environment are disturbed, they form a discrete color law family (the corresponding RGB values are omitted), and the color of the corresponding plants changes accordingly.

By simulating and analyzing the factor

The simulation of the RGB color solid by

The simulation of the HSL color solid by

When 30 ≤ H < 810, 26% ≤ S ≤ 100%, 26% ≤ L≤ 68% , the simulation of the HSL color solid by

When 90 ≤ H < 920, 28% ≤ S ≤ 94%, 33% ≤ L ≤ 78%, the simulation of the HSL color solid by

This paper proposes a dynamic color system theory based on the function P-set and presents a color reasoning algorithm for the P-law in a natural environment. The simulation experiment simulates the basic law of color variation when external factors change. The outcome of this paper will be applied in the color simulation of the IoT devices. When the natural conditions in the scene change, the plants will also change autonomously. The proposed algorithm can effectively extract color data, which can significantly reduce the data transmission bandwidth of color sensors in the IoT network.

Since the models and algorithms currently studied only simulate the color factors of plants, there are some points worthy of further study: 1) The time and space complexity of the algorithm can be analyzed; 2) The research and simulation of the color-law relationship between HSL and other standard color stereo, etc. To facilitate the analysis, this paper adopts the calculation method of normal distribution and incorporates the random function into the proposed method to obtain the expected effect, which will be further discussed in the follow-up research.

Acknowledgement: The authors are grateful to the anonymous referees for having carefully read earlier versions of the manuscript. Their valuable suggestions substantially improved the quality of exposition, shape and content of the article.

Funding Statement: This research is supported and funded by the Natural Science Foundation Project of Fujian Provincial Department of science and technology, Grant No.: 2020J01385, Digital Fujian industrial energy big data research institute, Grant No. KB180045, Provincial Key Laboratory of industrial big data analysis and Application, Grant No. KB180029, Sanming City 5G Innovation Laboratory, Grant No.:2020 MK18.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.

## References

- C. T. Poomagal, G. A. Sathish and D. Mehta, “Multi level key exchange and encryption protocol for internet of things (IoT),” Computer Systems Science and Engineering, vol. 35, no. 1, pp. 51–63, 2020.
- D. Kim, S. D. Min and S. Kim, “A dpn (delegated proof of node) mechanism for secure data transmission in iot services,” Computers, Materials & Continua, vol. 60, no. 1, pp. 1–14, 2019.
- S. K. Kim, M. Koppen, A. K. Bashir and Y. Jin, “Advanced ICT and IOT technologies for the fourth industrial revolution,” Intelligent Automation & Soft Computing, vol. 26, no. 1, pp. 83–85, 2020.
- M. Kamiyama and A. Taguchi, “Color conversion formula with saturation correction from HSI color space to RGB color space: Regular section,” IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, vol. 10, no. 7, pp. 1000–1005, 2021.
- L. Wang and W. Wang, “Real-time rendering of plant leaves,” SIGGRAPH ‘06 ACM SIGGRAPH 2006 Courses, vol. 1, pp. 712–719, 2006.
- Z. M. Amean, T. Low and N. Hancock, “Automatic leaf segmentation and overlapping leaf separation using stereo vision,” Array, vol. 12, no. 12, pp. 100099, 2021.
- E. J. Primka and W. K. Smith, “Synchrony in fall leaf drop: Chlorophyll degradation, color change, and abscission layer formation in three temperate deciduous tree species,” American Journal of Botany, vol. 106, no. 3, pp. 377–388, 2019.
- Y. Tian, “Advances in appearance modeling and photorealistic rendering of plant leaves,” Journal of Image and Graphics, vol. 17, no. 5,. pp. 613–620, 2012.
- F. Xia and S. Huang, “Application research of color design and collocation in image processing,” Computer Systems Science and Engineering, vol. 35, no. 2, pp. 91–98, 2020.
- H. Li, W. Zeng, G. Xiao and H. Wang, “The instance-aware automatic image colorization based on deep convolutional neural network,” Intelligent Automation & Soft Computing, vol. 26, no. 4, pp. 841–846, 2020.
- J. Wang and Y. Zhang, “Median filtering forensics scheme for color images based on quaternion magnitude-phase CNN,” Computers, Materials & Continua, vol. 62, no. 1, pp. 99–112, 2020.
- R. Krishna and S. Kumar, “Color image segmentation using soft rough fuzzy-c-means and local binary pattern,” Intelligent Automation & Soft Computing, vol. 26, no. 2, pp. 281–290, 2020.
- Y. Kang, F. Liu, C. Yang, X. Luo and T. Zhang, “Color image steg analysis based on residuals of channel differences,” Computers, Materials & Continua, vol. 59, no. 1, pp. 315–329, 2019.
- B. Desbenoit, E. Galin and S. Akkouche, “Modeling autumn sceneries,” in Proc. Eurographics, Vienna, Austria, pp. 107–110, 2006.
- F. N. Al-Wesabi, “A smart English text zero-watermarking approach based on third-level order and word mechanism of markov model,” Computers, Materials & Continua, vol. 65, no. 2, pp. 1137–1156, 2020.
- X. Y. Chi, “Simulation of autumn leaves,” Journal of Software, vol. 20, no. 3, pp. 702–712, 2009.
- K. F. Yang, “The visualization of aging process of leaves combined with environmental factors,” M.S. dissertation, Zhejiang University of Technology, China, 2010.
- Y. Tang and D. Y. Wu, “Computational approach to seasonal changes of living leaves,” Computational and Mathematical Methods in Medicine, vol. 2013, pp. 8, 2013.
- H. Zheng and D. Shi, “A Multi-agent system for environmental monitoring using boolean networks and reinforcement learning,” Journal of Cyber Security, vol. 2, no. 2, pp. 85–96, 2020.
- G. B. Bao and H. J. Li, “Large-scale forest rendering: Real-time, realistic, and progressive,” Computers & Graphics, vol. 36, pp. 140–151, 2012.
- K. Q. Shi, “Function P-sets,” International Journal of Machine Learning and Cybernetics, vol. 2, no. 4, pp. 281–288, 2011.
- G. Y. Zhang and E. Z. Li, “Information gene and identification of its information knock-out/knock-in,” An International Journal Advances in Systems Science and Applications, vol. 10, no. 2, pp. 308–315, 2010.
- K. Q. Shi and X. H. Li, “Camouflaged information identification and its applications,” An International Journal Advances in Systems Science and Applications, vol. 10, no. 2, pp. 6, 2010.
- S. L. Huang, W. Wang and D. Y. Geng, “P-Sets and its internal P-memory characteristics,” An International Journal Advances in Systems Science and Applications, vol. 10, no. 2, pp. 216–222, 2010.
- Y. Wang, H. Q. Geng and K. Q. Shi, “The mining of dynamic information based on P-sets and its applications,” An International Journal Advances in Systems Science and Applications, vol. 10, no. 2, pp. 234–240, 2010.
- K. Q. Shi, “P-Sets and its applications,” An International Journal Advances in Systems Science and Applications, vol. 1, no. 2, pp. 209–219, 2009.
- H. K. Lin and Y. Y. Li, “P-Sets and its P-separation theorems,” An International Journal Advances in Systems Science and Applications, vol. 10, no. 2, pp. 209–215, 2010.
- Y. Y. Li, Z. Li and K. Q. Shi, “Generation and recovery of compressed data and redundant data,” in Quantitative Logic and Soft Computing 2010, Berlin, Germany, Springer, pp. 661–671, 2010.
- J. M. Qiu and K. Q. Shi, “F-Rough law and the discovery of rough law,” Journal of Systems Engineering and Electronics, vol. 20, no. 1, pp. 81–89, 2009.
- J. M. Qiu and S. Kaiquan, “F-Interfere law generation and its feature recognition,” Journal of Systems Engineering and Electronics, vol. 20, no. 4, pp. 777–783, 2009.
- D. C. Montgomery, C. Douglas and C. George, “Central limit theorem,” Applied Statistics and Probability for Engineers, vol. 1, pp. 241, 2014.

## Cite This Article

H. Yu, J. Qiu, N. Cao and R. Higgs, "Intelligent color reasoning of iot based on p-laws,"*Computer Systems Science and Engineering*, vol. 45, no.3, pp. 3181–3193, 2023.