선정목록으로
A smart diagnostic tool based on deep kernel learning for on-site determination of phosphate, calcium, and magnesium concentration in a hydroponic system
필름·전자재료 · (11) 배리어 필름
기본 정보
- 저자
- DOI
- 10.1039/d1ra00140j
- 저널
- RSC Advances
- 발행년도
- 2021
- 발행기관
- Royal Society of Chemistry
- 피인용수
- 15
- 라이선스
- cc-by-nc
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1039/d1ra00140j
- 토픽
- Analytical Chemistry and Sensors
- OpenAlex ID
- W3137544173
평가 내용
- 관련도
- 사업분야
- 필름·전자재료 · (11) 배리어 필름
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '필름·전자재료 > 배리어 필름' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
A smart diagnostic tool based on deep kernel learning for on-site determining phosphate, calcium, and magnesium concentration in a hydroponic system.
본문 60,241자
본문 펼치기
# RSC Advances
## PA PER
Cite this: RSC Adv., 2021, 11, 11177
Received 7th January 2021
Accepted 23rd February 2021
DOI: 10.1039/d1ra00140j
rsc.li/rsc-advances
### 1. Introduction
## A smart diagnostic tool based on deep kernel learning for on-site determination of phosphate, calcium, and magnesium concentration in a hydroponic system
Vu Ngoc Tuan, abc Trinh Dinh Dinh, de Wenxin Zhang,ab Abdul Mateen Khattak,bf
Anh Tuan Le, <sup>bc</sup> Iftikhar Ahmed Saeed, <sup>ag</sup> Wanlin Gao <sup>*ab</sup> and Minjuan Wang <sup>*ab</sup>
Calcium, phosphate, and magnesium are essential nutrients for plant growth. The in situ determination of
these nutrients is an important task for monitoring them in a closed hydroponic system where the nutrient
elements need to be individually quantified based on ion-selective electrode (ISE) sensing. The accuracy
issue of calcium ISEs due to interference, drift, and ionic strength, and the unavailability of phosphate
and magnesium ISEs makes the development of these ion detecting tools hard to set up in a hydroponic
system. This study modeled and evaluated a smart tool for recognising three ions (calcium, phosphate,
and magnesium) based on the automatic multivariate standard addition method (AMSAM) and deep
kernel learning (DKL) model. The purpose was to improve the accuracy of calcium ISEs, determining
phosphate through cobalt electrochemistry, and soft sensing of magnesium ions. The model provided
better performance in on-site detecting and measuring those ions in a lettuce hydroponic system
achieving root mean square errors (RMSEs) of 12.5, 12.1, and 7.5 mg L <sup>�1</sup> with coefficients of variation
(CVs) below 5.0%, 7.0%, and 10% for determining Ca <sup>2+</sup>, H2PO4�, and Mg2+ in the range of 150–250,
100–200, and 20–70 mg L <sup>�1</sup> respectively. Furthermore, the DKL was implemented for the first time in
the third platform (LabVIEW) and deployed to determine three ions in a real on-site hydroponic system.
The open architecture of the SDT allowed posting the measured results on a cloud computer. This
would help growers monitor their plants' nutrients conveniently. The informative data about the three
mentioned ions that have no commercial sensors so far, could be adapted to the other components to
develop a fully automated fertigation system for hydroponic production.
Managing nutrients and monitoring plant growth in a hydroponic system are essential tasks in the modern farming industries. In a soilless cultivation, the total nutrient can be easily
manipulated by regularizing electrical conductivity (EC) and pH
values. However, the EC, pH based hydroponic systems have
issues of imbalanced nutrients caused by the unequal uptake of
aKey Laboratory of Agricultural Informatization Standardization, Ministry of
Agriculture and Rural Affairs, Beijing 100083, China
bCollege of Information and Electrical Engineering, China Agricultural University,
Beijing 100083, China. E-mail: minjuan@cau.edu.cn; gaowlin@cau.edu.cn
cFaculty of Electrical and Electronic Engineering, Nam Dinh University of Technology
Education, Nam Dinh 420000, Vietnam
dQuality Testing Lab, Center for Research and Development Science Technology Tien
Nong, Thanh Hoa, 442410, Vietnam
eCollege of Chemistry and Chemical Engineering, Beijing Institute of Technology,
Beijing, 102488, China
fDepartment of Horticulture, The University of Agriculture, Peshawar 25120, Pakistan
gDepartment of Computer Science, The University of Lahore, Pakistan
nutrient ions from a hydroponic solution by different plants
species. This is one of the major reasons for reduction in crop
productivity and quality in the closed-loop hydroponic systems. <sup>1</sup>
Therefore, the nutrient management systems need to be
equipped with real-time diagnostics, controlling essential
nutrient elements individually. Thus far, such a system is not
available commercially because of the lack of feasible ISEs, and
the complexity of the on-site measurement of individual ions.
A periodical analysis was used as a temporary solution to
minimize imbalance in nutrients by adjusting nutrient ratios in
the solutions. <sup>2</sup> However, this method was inefficient to induce
extra water and loss of nutrient control because of no real-time
feedback. The ISEs were used as an efficient method to overcome this problem. They supply timely feedback to the system
on individual ions for on-line regularization of ion ratio in the
nutrient solution. Nevertheless, the ISEs based hydroponic
systems face other problems, such as interferences (other ions,
temperature), changing ionic strength, potential dris, etc.
These negative impacts reduce the accuracy of ISEs measurements and the efficiency of ISEs-based closed-loop hydroponic
systems. Especially, a substantial impact is observed on bivalent
ions, such as, calcium and magnesium. In this regard, several
solutions for improving the accuracy of calcium ISE were
proposed. These include, using calibration techniques to
reduce dri, <sup>3–5</sup> using machine learning techniques (PLS, PCR)
to resolve interferences, <sup>6</sup> deploying neural network, <sup>7</sup> applying
the sampling technique and the processing model. <sup>4,8</sup> A combination of the sampling technique and advanced model was
recently proposed to overcome interferences, dri, and ionic
strength. <sup>4</sup> However, calcium is a major element that plants
require and is difficult to measure with high accuracy in
a hydroponic solution, especially in the on-site scenario.
Therefore, further validation needs to be done to measure
calcium ion with high precision in a hydroponic solution.
Phosphate is one of the essential plants nutrients that needs
to be diagnosed in the hydroponic solution for precision cultivation. Although various studies have focused on developing
phosphate sensing, only a few have been able to directly
measure phosphate because of its short lifetime, drastically
losing sensitivity, <sup>9</sup> and crucial interference of other ions. <sup>10</sup>
Cobalt-wire (Co) was a signicant milestone for developing
a phosphate selective electrode. It was quite useful in eld
analyses <sup>11</sup> and was cheap, simple, and robust. However, in the
wide range of pH states, phosphate anion species (PO43�,
wide range of pH states, phosphate anion species (PO43�,
HPO42�, H2PO4�) changed, which affected the accuracy phos
HPO42�, H2PO4�) changed, which affected the accuracy phos
phate detection. Therefore, quantifying phosphate ion
concentration in a hydroponics solution is complicated and less
accurate, even with a Co-based electrode <sup>10</sup> due to the unstable
electrode signal band. Several approaches have been devised to
resolve this issue, such as sensing data fusion for detecting
H2PO4� concentration in a paprika nutrient solution based on
H2PO4� concentration in a paprika nutrient solution based on
the near-infrared (NIR) spectroscopy technique, cobalt electrochemistry, and articial neural network (ANN) model. <sup>12</sup> Spectroscopy sensing technique aided with the machine learning
models is a relatively satisfactory method to detect phosphate
ion. However, it is expensive and infeasible for the on-line
measurement system. <sup>13</sup> Recently Tuan et al. <sup>14</sup> proposed an
approach combining the multivariate standard addition
sampling method and the ANN model for data fusion of four
cobalt electrodes. They achieved satisfactory results in determining phosphate ion in eggplant hydroponic solution. Nonetheless, an on-line and feasible phosphate measurement system
has not been proposed yet.
Like phosphate, there were many obstacles in developing
magnesium ion sensing mechanisms. Several studies devised
ionophores for detecting magnesium. <sup>15–17</sup> However, due to dri
and interference of other ions such as calcium, sulphate, etc., no
commercial magnesium ISE was introduced for determining
Mg <sup>2+</sup> efficiently. This inspired researchers to develop magnesium sensing more efficiently by applying the ISEs with
advanced processing techniques. For example, using a solid
contact ISE array supported by independent component analysis (ICA) with the genetic algorithm and back-propagation
neural network (BPNN). <sup>18</sup> This study achieved comparable
results. However, it also used complicated processing methods
and only worked well in an ideal environmental scenario, where
pH, ion strength, temperature, and other forms of interference
(from unknown ions) were relatively constant. Atas et al. <sup>19</sup>
proposed an ISE array electronic tongue that supported the
partial least squares (PLS) model for determining magnesium
and other elements in solution samples. This provided satisfactory results in determining magnesium, as well as, calcium.
However, this approach is still challenging as the lifetime of the
electrode is very limited (to almost a single analysis). The
analysis time is extended using of a number of solutions. Some
studies were recently proposed that combined special sampling
techniques and advanced processing models to predict
magnesium and phosphate from the raw data of an array of ISEs
of other ions. For example, Cho et al. <sup>8</sup> used the two-point
sampling procedure and ANN to predict the concerned ions
from a three ISEs array. However, the prediction magnesium
and phosphate detection of the study did not meet the
requirements of the actual hydroponic system. Tuan et al. <sup>4</sup>
combined the multivariate variate standard addition method
(MSAM) and the deep kernel learning (DKL) model to improve
the prediction results of two unavailable ions (magnesium and
phosphate) and six other available ISEs ions. This approach
provided a relatively comprehensive solution to resolve the problems of ISEs. With the model, although the prediction of phosphate and magnesium improved considerably, the results are still
incomparable with those achieved through actual ISEs. Moreover,
the DKL based model of that study was slightly complicated
(especially in the case of big data). Implementing DKL in the onsite measurement system has been a challenge because of the
computational cost of DKL core. No DKL model has been introduced in the actual system, i.e. the real hydroponic system.
Therefore, deploying ISEs and DKL in hydroponics need further
studies on evaluating their feasibility in real-time and on-site
nutrients monitoring in hydroponic systems.
This study proposes a smart diagnostic tool (SDT) for on-site
determination of three essential ions in a lettuce hydroponic
solution. The multivariate standard addition sampling technique <sup>14</sup> was applied to acquire data from one calcium ISE, four
cobalt-based phosphate ISEs, and one temperature probe. The
DKL, novel processing model, <sup>4</sup> was used to improve the accuracies of Ca <sup>2+</sup>, H2PO4� ISEs and enhance performance of Mg2+
ion prediction. The proposed model was trained and validated
with 100 imitated real hydroponic solution samples in a Python
environment. The sampling procedure based on the automated
multivariate standard addition method (AMSAM) and trained
DKL model were implemented in LabVIEW program for realtime monitoring concentrations of three ions in the hydroponic solution. Implementing a smart diagnostic tool based on
the automated multivariate standard addition method
(AMSAM) and DKL in LabVIEW is a novel approach for on-site
monitoring of ions concentration in a hydroponic system. The
computational challenge of applying the DKL model in the on-site
monitoring system was alleviated by optimizing and implementing the tted architecture in LabVIEW. Moreover, the predicted
concentration values are also posted to the cloud computing as an
online database. This cloud database was developed to validate the
feasibility of this study in the real hydroponic system, where
several modules continuously exchange data and supply information to manage the entire system (Fig. 1).
Fig. 1 The novel smart diagnostic tool (SDT) based on AMSAM-FEdeep kernel learning for determining calcium, phosphate, and
magnesium concentration in a hydroponic system.
### 2. Materials and methods
2.1. Experiment preparation
2.1.1. Sensor array and apparatus. A sensor array was set up
with 5 sensors, including a commercial ISE Orion 9320BNWP
(Thermo Fisher Scientic, USA), which was used for determining calcium ion. Four ISEs were fabricated from a cobalt rod
(99.99% pure, 5 mm diameter, Sigma-Aldrich, USA) for sensing
phosphate. For the phosphate electrodes fabrication, a 5 mm
long cobalt rod was soldered to a copper wire (Ø ¼ 1 mm). The
bimetal structure (cobalt–copper) was covered by an acrylonitrile butadiene styrene (ABS) plastic stem (a 3D printed pipe
with 100 mm length, 12 mm external diameter, and 6 mm
internal diameter). The Bayonet Neill–Concelman (BNC) cable
was jointed with metallic ISEs for convenience in connection. <sup>14</sup>
The 400 and 1200 grit emery papers were utilized to polish the
electrodes. Further, the electrodes were pre-treated with
distilled water for 30 minutes and then conditioned in potassium hydrogen phthalate buffer (KHP) 0.04 mol L <sup>�1</sup> for 20
minutes. <sup>20</sup> The formed electromotive forces (EMF) between
a reference electrode (Orion 900200, Thermo Fisher, MA, USA)
and the activated cobalt electrodes were collected for determining phosphate concentration. The temperature of samples
was detected by a temperature probe (Pt100; Yuace, China). All
of the sensors were plugged into an ABS-sensor chamber (a 3D
printer lab product). The sensor chamber was adapted with
other components, such as electromagnetic valves (V1, V2),
electric pump (P1), and peristaltic pumps (P2, P3) to form an
automated sampling system based on the MSAM technique. <sup>14</sup>
The solutions, including waste, deionized water, KHP, real
hydroponic nutrient solution, cycled hydroponic nutrient
solution, were kept in tanks T1, T2, T3, T4, and T5, respectively.
The base characteristics of sensors and apparatus are summarized in Table 1. The array sensors were connected to an INA 116
(Texas Instruments, USA) based conditioning amplier. A data
acquisition device (NI USB DAQ 6218 National Instrument
Corporation, USA) was used to acquire and transfer data to
a computer. A smart diagnostic program based on DKL implemented in LabVIEW (LabVIEW 2017, National Instrument
Corporation, USA) was utilized to process data and quantify the
concentration of the three considered ions (Fig. 1).
Fig. 2 depicts the progress to develop a smart diagnostic tool
to determine three ions in a hydroponic system. The process of
developing SDT was divided into two parts, (i) modeling the
DKL core model of SDT in Python environment and (ii) implementing the automated multivariate standard addition
sampling module and DKL in LabVIEW platform. In the Python
environment, the training samples were prepared manually,
acquired by a task in the LabVIEW program rst, and the data
were exported to a comma-separated-values (CSV) le for the
DKL model training. To improve the model performance, the
raw data features were enriched deploying the feature enrichment technique, <sup>14</sup> explained in Section 2.2.2. The dataset was
then normalized into a range of [�1, 1] to increase training
speed. The normalized dataset was introduced to develop the
DKL model. The DKL model was trained, tested, and evaluated
by a modeling program based on Python and several Libraries.
The trained parameters (including weights, biases, and kernel
matrices) were exported to .txt les for implementing the DKL
in LabVIEW. In the LabVIEW platform, an automated sampling
module based on multivariate standard addition methodMSAM <sup>4,14</sup> was developed for an on-site measurement in the
actual hydroponic system (see the detail of this module in
Section 2.2.1). The samples were enriched with features,
normalized, and introduced into the DKL implemented in
Table 1 Characteristics of the ISEs, sensors, and other components used in the study
Components Specication Manufacturer
Calcium ISE: Orion 9720BNWP 0.02–40 000 mg L <sup>�1</sup> ; PVC membrane Thermo Fisher, USA
Phosphate ISE1 Co-metal membrane Lab design
Phosphate ISE2 Co-metal membrane Lab design
Phosphate ISE3 Co-metal membrane Lab design
Phosphate ISE4 Co-metal membrane Lab design
Reference electrode: Orion 900200 Double conjunction electrode Thermo Fisher, USA
Temperature probe: Pt100 0–100 <sup>�</sup> C; power 24VDC Yuace, China
Electromagnetic valve (V1, V2) FFY23 series TR-6; 24VDC Wuxi Teradyne, China
Electric pump (P1) KLP05-6; power 6VDC; ow rate 450 mL min <sup>�1</sup> Kamoer, China
Peristaltic pump A (P2) NKP-DA-S10B; power 24VDC; ow rate 80 mL min <sup>�1</sup> Kamoer, China
Peristaltic pump B (P3) S300-2B-JZ15B; power 24VDC; ow rate 192.39 mL min <sup>�1</sup> Di Chuang, China
Acquisition device NI USB 6218 National Instrument Corporation, USA
Buffer ISEs' signals INA116 Texas Instrument, USA
LabVIEW. The DKL predicts and transfers the outcome of the
considered ions concentration via the un-normalized processing. The concentrations of three ions are displayed and also posted
to the cloud computing database of ThingSpeak <sup>21</sup> open service
(Matwork, Natick, MA, USA) for distributed monitoring and manipulating purposes. The real concentration values of the actual samples
were analyzed at the Laboratory of Agricultural Informatization
Standardization, Ministry of Agriculture and Rural Affairs, CAU,
Beijing, China, at the International Joint Research Center of Aerospace Biotechnology and Medical Engineering, Beihang University,
Beijing, China, and at Quality Testing Lab, Center for Research and
Development Science Technology Tien Nong, Thanh Hoa, Vietnam.
2.1.2. Sample preparation. Training samples for developing the DKL-core of the smart diagnostic tool was prepared
from standard solutions in the laboratory. Then SDT was validated by on-site monitoring of three target ions to verify the
feasibility of the SDT structure in the real hydroponic systems
(Fig. 3). To imitate the interaction of matrix ions of the hydroponic solution, a basic solution (BS) mixed as per the Hoagland
standard solution <sup>22</sup> and tap water (1/1 v/v), was used to prepare
the training samples. The fractional factorial design (FFD)
method <sup>23,24</sup> was deployed to prepare 100 training samples (100
¼ 10 <sup>2</sup>, for 10 levels of three factors-3 ions, as shown in Table 2).
The temperature of samples was randomly adjusted from 15 <sup>�</sup> C
to 33 <sup>�</sup> C (corresponding to the temperature of real hydroponic
systems) using a water bath HH.S21-4 (Boxun, Shanghai, China)
for eliminating temperature interference.
To mimic the matrix background of real hydroponic
samples, a basic solution (BS), mixing Hoagland standard
solution <sup>22</sup> and tap water (1/1 v/v), was used to prepare the
training samples. Standard solutions (SS) of 10 mL were
prepared by mixing BS solution with appropriate amounts of
stock solutions of potassium dihydrogen phosphate, magnesium sulfate, calcium nitrate to range the concentration of
concerned ions from the rst to the tenth level of 10–350, 10–
668 mg L <sup>�1</sup>, and 5–125 mg L <sup>�1</sup> for Ca <sup>2+</sup>, H2PO4�, and Mg2+,
respectively (Table 2). A training sample set for developing the
proposed model, having 100 samples, was prepared by using
the MSAM technique. KHP buffer solution (25 mL, 0.035 M) was
rst injected into the sensor chamber. The solution inside the
sensor chamber was then cycled by an electric pump (KLP05-6,
Kamoer Company, China) until the ISEs' EMFs (U0) were
Fig. 2 Flow chart of progress in Python and LabVIEW environments to develop a smart diagnostic tool for determining three ions (calcium,
phosphate, and magnesium) in a hydroponic system.
Fig. 3 Lettuce plants growing in a plant factory (a) and the on-site measurement system used in the study (b). (1) Computer with DKL based SDT
model; (2) power supply; (3) NI 6218 DAQ device; (4) ISEs interfacing module; (5) sensors array; (6) sensor chamber; (7) peristaltic pump B; (8)
peristaltic pump A; (9) driver board of pumps and valves; (10) magnetic valve 1; (11) electric pump; (12) magnetic valve 2; (13) waste tank; (14)
sample tank; (15) distilled water tank; (16) KHP tank.
stabilized (about 60 seconds). The standard solution was injected into the chamber. For 3 minutes of cycling, the potentials of
the electrodes (Ux) were stabilized. The data acquisition program
based on LabVIEW (LabVIEW 2017, National Instrument Corporation, USA) collected the stabilized EMF values and exported them
to the CSV le for developing the model. The DKL model was
developed by Python 3.6.2, Scikit-Learn library, SciPy, and several
third-party libraries, and then implemented by using LabVIEW for
the on-site monitoring stage (Fig. 3).
2.2. Development of the smart diagnostic tool
2.2.1. Developing automated multivariate standard addition sampling module. The timing diagram of an automated
multivariate standard addition method (AMSAM) is illustrated
in Fig. 4 (for 1 cycle). One sample was acquired in 1 cycle. At t1
a starting pulse from the main program activated the AMSAM to
sample. P1 and P2 were turned on, for Dt1 (30 seconds) to pump
the buffer solution from the KHP tank (T3), P2 was turned off (to
get 25 mL volume of the KHP). Aer 60 seconds (Dt2) from
starting pulse, the KHP was cycled by P1, during which the DAQ
device acquired stable potentials from the electrodes (U0). The
pump P3 was then activated (at t3) and maintained for 30
seconds (Dt3) for pumping the real hydroponic sample solution
(10 mL) from the real hydroponic solution tank (T4) to the
sensor chamber. The combined solution in the sensor chamber
was mixed and cycled for 180 seconds (Dt4) till the electrodes'
signals were stable. The EMFs of electrodes (Ux) were collected.
The potentials (U0) and (Ux) were then introduced to the next
step for feature enrichment, normalization, and prediction, etc.,
(Fig. 2). At t5 electromagnetic valve V1 was activated for 30
seconds (Dt5), the measured sample was drained out of the sensor
chamber to the waste tank (T1). At t5 switching off V1 and on V2
stopped draining and started rinsing solution from the water tank
(T3) to the sensor chamber for 30 seconds (Dt6), then the sensor
array rinsed for 30 seconds (Dt7). At t7 when the rinsing completed,
the draining V1 was turned on again to drain the wastewater out of
the sensor array for 30 seconds (Dt8). At t9 both pump P1 and
electromagnetic valve V1 were stopped to nish one automated
sampling cycle. The main program can call the automated
sampling cycle to acquire the signals of the real sample.
Table 2 The ranges concentration of three considered ions prepared training samples
Ions Level 1 Level 2 Level 3 Level 4
Level Level Level Level Level
5 6 7 8 9 Level 10
Calcium (mg L <sup>�1</sup> ) 10 25 50 75 100 125 175 225 275 350
Phosphate (mg L <sup>�1</sup> ) 10 20 45 70 100 150 225 350 500 668
Magnesium (mg L <sup>�1</sup> ) 5 15 25 35 45 55 70 85 105 125
K(X,X) at training locations X, K(X*,X*) at testing locations, and
K(X*,X) at training locations and testing locations. <sup>26</sup>
f ðX Þ
f ðX*Þ
- - - ��
KðX ; X Þ KðX ; X*Þ
- N 0; (2)
KðX*; X Þ KðX*; X*Þ
Fig. 4 The timing diagram of the automated multivariate standard
addition method (AMSAM) processing.
2.2.2. The signal processing model of the smart diagnostic
tool. The SDT was developed based on an automated novel
sampling technique-AMSAM and an advanced signal processing
model-DKL. This way, the DKL model was used to resolve the
problems of ISEs (interferences, dri, etc.). Moreover, the data
provided by the automated multivariate standard addition method
(AMSAM) based on MSAM <sup>4,14</sup> was the foundation for reducing
ionic strength and dri effects. The raw dataset was acquired from
the sensor array. DKL model was an elegant and exible algorithm, <sup>25</sup> a combined structure of deep neural network and kernel
methods. The DKL and AMSAM were applied to develop a smart
diagnostic tool for determining on-site concentrations of the three
ions in a hydroponic nutrient solution. The 11 feature (including 5
raw ISEs' signals, 5 enriched ISEs' signals, and one temperature
signal) dataset was introduced to the DKL, which was improved to
supply useful information using the feature enrichment technique. <sup>14</sup> The enriched principle is performed as in eqn (1) and
depicted in Fig. 1. Ten data features were formed from ve original
features (5 ISEs' EMFs) and ve feature enrichment (FE) data.
UFEij ¼ Uxij - U0ij (1)
where i, j – the index of samples (1 to 100), and the ion-selective
electrodes (1 to 5), respectively. U0ij, Uxij - the ISEs' potentials
corresponding to the concentration C0 and Cx respectively. UFEij
- the values of the difference between U0ij and Uxij (enriched data
values) were used to improve the performance of the model. See
ref. 14 for more information on this technique.
The DKL was modeled by the cross-validation technique with
k-fold (k ¼ 10). The dataset was divided into a training set D ¼
{X <sup>i</sup>,y <sup>i</sup> }, i ¼ 1, 2, .,n and a testing set D* ¼ {X* <sup>k,yk</sup> - <sup>}, k ¼ 1, 2, ., n</sup> - <sup>.</sup>
The Gaussian process was dened by three covariance matrices
The GP stage in DKL has a functional equivalent as an
innite number of nodes Bayesian neural network. <sup>27</sup> Therefore,
the posterior distribution of the input data was used to predict
the expected target ions.
f(X*)jy(X) - N(m*,S*) (3)
where m* was the predictive mean and calculated as follows <sup>26</sup>
m* ¼ m(X*) + K(X*,X)[K(X,X) + s <sup>2</sup> I] <sup>�1</sup> (y(X) � m(X)) (4)
m* ¼ f(X*) ¼ K(X*,X)[K(X,X) + s <sup>2</sup> I] <sup>�1</sup> y(X) (5)
Eqn (5) was used to compute the prediction of the outputs of
DKL. To conveniently implement the DKL and calculate the
predictions in a different environment (for example, LabVIEW),
we can compute the predictions as follows <sup>26</sup>
m* ¼ f(X*) ¼ K(X*,X)a (6)
where a ¼ [K(X,X) + s <sup>2</sup> I] <sup>�1</sup> y(X), the trained parameters from the
program in the training environment (Python).
The given data were processed in two stages. First, in the
forward stage of the neural network, the high-dimensional input
vector was propagated to the lower-dimensional vector. The lowdimensional data were then processed by the GP stage. The DKL
architecture is also considered as a stand-alone deep kernel-based
GP. <sup>25</sup> Thus we can use expression (7) to describe the structure of
DKL with a base kernel k(x <sup>[i]</sup>,x <sup>[j]</sup> jq) and kernel parameters q.
k(x <sup>[i]</sup>,x <sup>[j]</sup> jq) / k(g(x <sup>[i]</sup>,w),g(x <sup>[j]</sup>,w)jq,w) (7)
The neural network performs a non-linear mapping by
g(x,w), and the weight parameter (w). Kernel RBF, dot-product,
and Mat´ern kernel (Table 3) were used to estimate the tted
architecture of the DKL model. The maximizing log marginal
likelihood of the targets y was used to perform kernel learning
algorism for DKL. The probability of the data conditioned only
on kernel parameters q is given as;
log p(Yjq,X) f �Y <sup>T</sup> (Kq(X,X) + s <sup>2</sup> I) <sup>�1</sup> Y � logjKq(X,X) + s <sup>2</sup> Ij (8)
Table 3 The kernels used to develop the DKL core of the SDT in this study
Kernels Radial basic function (RBF) Dot-Product Mat´ern kernel
kðx; x <sup>0</sup> Þ ¼ <u>1</u>
GðyÞ2 <sup>y�1</sup>
<u>2y</u>
dðx; x <sup>0</sup> Þ
l
!y
Ky
0Þ
!
Function
kðx; x <sup>0</sup> Þ ¼ exp
��ðx � <u>x0Þ2</u>
pf f i f f iffi
<u>2y</u>
2l <sup>2</sup>
k(x,x <sup>0</sup> ) ¼ x.x <sup>0</sup>
pf f i f f iffi
<u>2y</u>
dðx; x
l
l is length-scale l - length-scale; y – const; d(x,x <sup>0</sup> ) – Euclidean distance;
Ky – modied Bessel function; G – gamma function
Table 4 The considered parameters for developing the DKL core of
the smart diagnostic tool
Parameters Values
Number of layers 1, 2, 3, 4, 5, 6
Size of hidden layer 1 to 1000
Transfer function f(x) of Tansig, logsig, linear, ReLU
hidden layers
Transfer function of the
output layer
ReLU
Optimization algorithm Stochastic gradient descent (SGD), Broyden–
Fletcher–Goldfarb–Shanno (BFGS), Adam
Dropout rate 0.5 to 0.99
Learning rate 0.001 to 0.1
Max number of epochs 2000
Prior white noise level 0.001 to 1
Kernel Radial basic function (RBF), dot-product,
Mat´ern kernel
Training goal 10 <sup>–6</sup>
Modelling DKL concerns optimizing learnable parameters,
such as network weights and kernel parameters, and tweaking the
hyper-parameters, i.e., the learning rate, number of iterations, and
number of neurons (nodes) in each layer of the neural network.
First, the hyper-parameters were chosen with appropriate values.
Cross-validation over a small hyper-parameter search-space and
a systematic optimization-based procedure was then applied to
train the model. The main hyper-parameters were tuned, including
the number of neurons of each hidden layer, the number of
epochs, training iterations, the learning rate, and the prior whitenoise level of the Gaussian process (Table 4).
The parameters of the neural stage (w) and kernel parameters of GP (q) were jointed to all parameters of the DKL, g ¼
{w,q}, and eqn (8) was deployed to maximize the log posterior
marginal likelihood. The standard back-propagation technique
was employed to compute the derivatives concerning the weight
variables <sup>vgðx; wÞ</sup> ~~.~~ The dropout algorithm was used to resolve
vw
the overtting and local minima problems. The dropout rate
ranged from 0.5 to 0.99. <sup>28</sup>
### 3. Results
3.1. Determining the core structure of the smart diagnostic
tool
DKL model is the core of the smart diagnostic tool. Numerous
trials were conducted to determine the major parameters and
the hyper-parameters network (Table 4) for the best-t DKL
architecture. Five DKL core structures were considered (Table
5). The DKL model structure was tuned within ve layers of the
neural network and an RBF kernel-based Gaussian process. The
Table 5 The structures of the DKL models for coring the smart diagnostic tool (SDT) <sup>a</sup>
Layer 1 Layer 2 Layer 3 Layer 4 Layer 5
Models
N.o.N AF DR N.o.N AF DR N.o.N AF DR N.o.N AF DR N.o.N AF DR Opt LR N.o.E KF
DKL1 600 Tanh 0.99 4 Linear - - - - - - - - - - Adam 0.005 1750 RBF
DKL2 160 Tanh 0.99 600 Tanh 0.99 4 Linear - - - - - - - Adam 0.005 1750 RBF
DKL3 160 Tanh 0.99 160 Tanh 0.99 600 ReLU 0.99 4 Linear - - - - Adam 0.005 1750 RBF
DKL4 160 Tanh 0.99 160 Tanh 0.99 600 ReLU 0.99 600 ReLU 0.99 4 Linear - Adam 0.005 1750 RBF
DKL5 160 Tanh 0.99 600 Tanh 0.99 600 ReLU 0.99 600 ReLU 0.99 4 Linear - Adam 0.005 1750 RBF
a Number of neurons – N.o.N, activation function – AF, dropout rate – DR, optimizer – Opt, learning rate – LR, number of epochs – N.o.E, kernel
function – KF.
Fig. 5 Relationship between the number of epochs and loss values of the models (a), and between PC components and variance of the dataset
with RMSEs (b).
ANN stage of DKL was constructed by the Tanh, ReLU, and
linear activation functions. The dropout algorithm was applied
to train the network to eliminate overtting problems and local
minima. Adam optimizer and standard mean squared error loss
function were adopted for tuning the model. <sup>29</sup> Furthermore, to
evaluate the most effective model for determining the three ions
in the hydroponic nutrient solution, ve DKL (DKL1 to DKL5)
structures with layers, and nodes were explicitly tuned to
determine the suite DKL structure for developing the SDT
architecture (Table 6).
A comparison of the loss values of ve cases of DKL architectures corresponding with the number of epochs change is
depicted in Fig. 5a. The DKL3 was the best t structure for SDT
because of its lowest loss value. The number of neurons of the
last layer of the ANN stage was determined by trading-off the
root mean square error values of predicting three ions and the
coefficient of principal component (PC) analyzed from the high
dimensional data of the AMSAM-FE. Removing PCs from the
raw allows the models to eliminate the noise <sup>30</sup> and improve
predicting targeted ions. The relationship between the number
of PCs and the prediction RMSEs of three ions are illustrated in
Fig. 5b. The RMSEs of the models achieved the minima values at
4 PCs, and the DKL3's RMSEs values are the lowest (Fig. 5b).
3.2. Performance of DKL with lab samples
The prediction of calcium ion was more stable and linear for
DKL3 (RMSE 17.63 mg L <sup>�1</sup>, R <sup>2</sup> 0.99, and slope 1.005) than for
other DKL structures (Fig. 6a). The DKL1 showed a slightly good
linear relationship (RMSE 27.02 mg L <sup>�1</sup>, R <sup>2</sup> 0.97, and slope
0.93), which was approximate to that of DKL4 (RSME
28.02 mg L <sup>�1</sup>, R <sup>2</sup> 0.96, and slope 0.97) but relatively better than
those of the DKL2 (RSME 32.52 mg L <sup>�1</sup>, R <sup>2</sup> 0.96, and slope 0.97)
and DKL5 (RSME 54.91 mg L <sup>�1</sup>, R <sup>2</sup> 0.92, and slope 0.86) models.
Akin to calcium, the phosphate prediction of DKL3 was good too.
The DKL3 exhibited enhanced results with lower RMSEs
(33.71 mg L <sup>�1</sup> ), higher performance coefficient (0.99), and better
slope (0.98). The performance of DKL4 for predicting phosphate was
better than those of DKL1, DKL2, and DKL5. The phosphate
prediction of DKL5 was the worst with the highest RMSEs and the
low linear relationship (RSME 93.79 mg L <sup>�1</sup>, R <sup>2</sup> 0.92, and slope 0.82).
The DKL3 exhibited good prediction results not only for
available ISE ions (Ca <sup>2+</sup>, H2PO4�) but also for unavailable ISE ion
(Mg <sup>2+</sup> ). The magnesium prediction of DKL3 was satisfactory with
relatively low RMSEs, good performance coefficient, and slightly
higher slope (RSME 12.51 mg L <sup>�1</sup>, R <sup>2</sup> 0.92, and slope 0.86). The
magnesium prediction result of DKL4 was better than those of
DKL1, DKL2, and DKL5. However, the performance of DKL4 (RSME
17.36 mg L <sup>�1</sup>, R <sup>2</sup> 0.91, and slope 0.88) was still lower than that of
DKL3. The relationships of the predicted concentrations (y) and
the actual values (x) of the models are summarized in Table 6.
3.3. In-line application of the smart diagnostic tool in
lettuce hydroponic system
3.3.1. Implementing deep kernel learning in LabVIEW. A
trained deep kernel learning is a computational model. It
consists of a deep neural network with interconnected neurons.
Every neuron in a layer is connected to the neurons of the
previous layer. The connections between layers have different
strengths or weights. The input data enter and pass-through
layer by layer up to the output. In this study, the DKL was
implemented in LabVIEW, which is an advanced language and
can be applied in a real-time system. <sup>31</sup> The weights and biases of
Fig. 6 Relationships between predicted ion concentrations of the DKL
model and standard analyzers. (a) Ca <sup>2+</sup>, (b) H2PO4�, and (c) Mg2+. Error
bars are three replicates' standard deviations.
Table 6 The relationship of the predicted concentrations (y) and the actual values (x) of the models
Species Models Predicting equation RMSE <sup>a</sup> (mg L <sup>�1</sup> ) Coefficient of performance <sup>b</sup> (R <sup>2</sup> )
Calcium DKL1 y ¼ 0.93x + 11.81 27.02 0.97
DKL2 y ¼ 0.97x + 9.92 32.52 0.96
DKL3 y ¼ 1.005x - 0.21 17.63 0.99
DKL4 y ¼ 0.97x + 4.08 28.02 0.96
DKL5 y ¼ 0.86x + 19.58 54.91 0.92
Phosphate DKL1 y ¼ 0.93x + 27.17 58.22 0.97
DKL2 y ¼ 1.006x + 2.24 52.48 0.97
DKL3 y ¼ 0.98x - 1.28 33.71 0.99
DKL4 y ¼ 1.02x + 3.58 48.67 0.98
DKL5 y ¼ 0.82x + 35.99 93.79 0.92
Magnesium DKL1 y ¼ 0.74x + 17.07 22.43 0.85
DKL2 y ¼ 0.66x + 22.76 24.25 0.80
DKL3 y ¼ 0.86x + 7.65 12.51 0.92
DKL4 y ¼ 0.88x + 5.17 17.36 0.91
DKL5 y ¼ 0.51x + 30.24 29.79 0.65
, where n is the total number of data in the training set or test set, yi is the actual ion concentration value, and ˆyi is
a The RMSE ¼
sf f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f iffi
<u>1</u> Xn
ðyi � y^iÞ <sup>2</sup>
f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f iffi
<u>1</u> Xn
ðyi � y^iÞ <sup>2</sup>
n
f f f f f f f f f f f f f f f
Xn
i¼1
the predicted ion concentration value. <sup>b</sup> the R <sup>2</sup> ¼ 1 �
P
~~P~~ <u>i</u>
i
ðyi - y^iÞ <sup>2</sup>
~~ð~~ <u>yi</u> - y^iÞ <sup>2, where �yi</sup> <sup>is the average of the test set.</sup>
the deep neural network stage and the a parameters of the GP
stage were xed aer the generation of the trained model. They
were saved in the form of .text les in the computer hard drive.
A trained DKL model consists of input processing, layer 1, layer
2, layer 3, layer 4, GP layer, and output processing stage.
The implementation of these blocks in LabVIEW are
explained with the help of mathematical equations as follows.
(a) Normalization input process. As mentioned above, the
dataset fed DKL was scaled in the range of [�1 to 1] based on
MinMaxScaler of the Scikit Learn library. In the LabVIEW
platform, the scaled data (dscaled) was also calculated from the
maximum value of data (dmax), the minimum value of data
(dmin), the range between dmax and dmin (drange ¼ dmax - dmin),
the minimum of scaled value (scalemin ¼ �1), and the
maximum of scaled value (scalemax ¼ 1). The dscaled is computed
as follows
Some math tools from the numeric pallet in LabVIEW were
used. The weights (W1) were multiplied with the inputs data X1.
The production result was added with the biases. The result of
this addition was then transformed with a Tanh activation
function
- <u>2</u>
f ðzÞ ¼ 1 þ e <sup>�2z</sup> <sup>�</sup> <sup>1</sup> .
dscaled ¼ <sup><u>ðd �</u></sup> <sup><u>dminÞ</u></sup>
drange
ðscalemax � scaleminÞ þ scalemin (9)
(c) Layer 2. Weight (W2) and bias (b2) matrices of layer 2 saved
in .text les were imported in LabVIEW for calculating the
second layer of DKL. The output of layer 1 (Olayer1 ¼ X2) was
given to layer 2. Thus the output of layer 2 is given by eqn (11)
Olayer2 ¼ Tanh(W2X2 + b2) (11)
The sub-program was also implemented in LabVIEW using
the numeric pallet, such as a multiplier, adder, and Tanh
function.
(d) Layer 3. Weight (W3) and bias (b3) matrices of layer 3 saved
in .text les were further imported in LabVIEW for calculating the
third layer of DKL. The output of layer 2 (Olayer2) was given to layer 3
input (X3). Hence the output of layer 3 is presented by eqn (12)
Olayer3 ¼ ReLU(W3X3 + b3) (12)
Eqn (9) is implemented in LabVIEW for the scaling of input
vectors. The implementation is done using mathematical
pallets such as divider, subtracter, adder, minima, and maxima.
(b) Layer 1. The output (dscaled ¼ X1) of the normalization
input processing stage was given to the inputs of layer 1. The
weight and bias matrices of layer 1 of the trained DKL were
saved as .txt les for implementing the model in LabVIEW. The
rst layer of DKL performed by sub-program in LabVIEW
follows eqn (10)
Olayer1 ¼ Tanh(W1X1 + b1) (10)
(e) Layer 4. Similarly, weight (W3) and bias (b3) matrices of
layer 4 saved in .text les were imported in LabVIEW for calculating the fourth layer of DKL. The output of layer 3 (Olayer3) was
given to layer 4 (X4). So the output of layer 4 is shown by eqn (13).
The sub-program was also implemented in LabVIEW using the
numeric pallet, such as multiplier, adder, and linear function.
The sub-program was also implemented in LabVIEW using
the numeric pallet, such as multiplier, adder, and ReLU func
.
tion
f ðzÞ ¼ f <sup>0;</sup> z\0
z; z $ 0
Fig. 7 The block diagram of the DKL core of the smart diagnostic tool implemented in LabVIEW.
Olayer4 ¼ linear(W4X4 + b4) (13)
(f) GP stage. The predicted outputs are computed following
eqn (15). That is the product of the covariance matrix of testing
data (X*) and training data (X) and the trained hyperparameter
(atrained)
ypredicted ¼ K(X*,X)[K(X,X) + dn2I]�1y (14)
ypredicted ¼ K(X*,X)atrained (15)
The sub-program was also implemented in LabVIEW by
using the numeric pallet, such as product matrix function.
(g) Un-normalization output process. This stage was used to unnormalize the signal from GP output. The values of targets
(dunscaled) were calculated by simple functions (i.e., division,
subtraction, multiplication, and addition), as the following eqn
(16).
<u>ðdscaled �</u> <u>scaleminÞ</u>
dunscaled ¼ ðscalemax � scaleminÞ <sup>~~d~~</sup> <sup>range þ dmin</sup> (16)
The block diagram of the DKL of the SDT is depicted in
Fig. 7. Where X_test ¼ d_scaled comes from the normalization
subprogram, Y_predicted output is the target.
Fig. 8 reveals the front panel of the SDT. The sample setting
area, including the numeric controls and the button controls
could be used to set the standard concentrations of the three
considered ions, and pump the solutions (KHP, sample, and
rinse solutions) in automated/manual (Au/Man) mode. The
predicted concentrations of the three target ions were displayed
on the numeric indicators (current ion concentrations area) and
Fig. 8 The front panel of the smart diagnostic tool implemented in LabVIEW.
Fig. 9 Comparison between predicted ion concentrations of the
smart diagnostic tool and standard analyzers. (a) Ca <sup>2+</sup>, (b) H2PO4�, and
(c) Mg <sup>2+</sup> . Error bars are three replicates' standard deviations.
the graph (graph monitoring the three ions area). Besides, the
ISEs' EMF was indicated on the ISE signals monitoring area.
3.3.2. On-site validating the AMSAM-DKL-based SDT. Aer
implementing the AMSAM-DKL structure in the LabVIEW
platform, the SDT was validated by deploying an on-site
measurement of the ions (calcium 150 to 250 mg L <sup>�1</sup>, phosphate 100 to 200 mg L <sup>�1</sup>, and magnesium 20 to 70 mg L <sup>�1</sup> ) in
the nutrient solution of lettuce crop planted in the experimental
plant factory of the College of Information and Electrical
Engineering, China Agricultural University (CIEE, CAU), Beijing, China. The AMSAM task of SDT automatically acquired
each sample per day. The predicted results of the three ions of
the 27 samples are depicted in Fig. 9 and Table 7.
The calcium prediction results are illustrated in Fig. 9a and
Table 7. The results of four DKL showed a relatively accurate
prediction with RMSE of 29.2, 17.9, 19.3, and 25.1 mg L <sup>�1</sup> and
CV of 8.9, 8.8, 9.2, and 11.2%, for DKL1, DKL2, DKL4, and DKL5,
respectively. The result of DKL3 was the best with the lowest
RMSE of 12.4 mg L <sup>�1</sup> and a CV of 4.1%.
Fig. 9b and Table 7 present the prediction results of phosphate ion of the proposed models. The graphs have a trend
similar to that of calcium. However, the accuracy of phosphate
prediction was slightly lower than that of calcium. The RMSEs
were 25.7, 18.2, 12.1, 24.1, and 27.8 mg L <sup>�1</sup> with CVs of 12.1, 9.8,
6.2, 10.8, and 26.6%, for DKL1, DKL2, DKL3, DKL4, and DKL5,
respectively. Specically, the error prediction of phosphate at
the 15 <sup>th</sup> sample raised sharply. Nevertheless, the precision of
phosphate prediction was satisfactory for determining H2PO4�
element in the hydroponic system.
The magnesium prediction results are shown in Fig. 9c and
Table 7. The results of four DKL models (RMSEs of 17.2, 10.5,
11.0, and 13.8 mg L <sup>�1</sup> with respective CVs of 18.1, 11.9, 16.3,
and 56.6%, for DKL1, DKL2, DKL4, and DKL5, respectively)
showed lower accuracies than those of the DKL3 (RMSE of
7.5 mg L <sup>�1</sup> with CV of 9.6%). At the 15 <sup>th</sup> sample, the prediction
error of magnesium was substantially higher than those of
other samples. The uctuated magnesium prediction trend was
similar to phosphate. However, the trends were opposite
(Fig. 9b and c).
### 4. Discussion
We modeled and implemented a smart diagnostic tool for onsite concentrations measurement of the three ions in a hydroponic system. The core of the SDT was a combination of the
AMSAM-FE sampling method and the DKL model. The novel
on-site measurement with this approach could overcome the
drawbacks of ISEs for determining the concentration of available ISEs ion (Ca) and unavailable ISEs ions (P and Mg). The
results showed that the SDT could be used to online-measure
three ions in the hydroponic system with a relatively satisfactory accuracy. However, at the 15 <sup>th</sup> sample, the achieved phosphate and magnesium predictions were not high accuracies (see
Fig. 9b and c). These errors may be due to an issue with the
reference electrode (RE). The inner solution of RE ran out in
order to reach the lowest level. That affected the EMF of Coelectrodes over the trained range and caused the inaccuracy
predictions. The variating EMF of Co-ISEs also induced inaccuracy in magnesium prediction since magnesium concentration was predicted by fusing the signals from Co-electrodes and
calcium electrode (CE). However, the calcium prediction was
still stable because CE is a combination electrode (i.e., it has its
own independent RE). This is an advantage of the combination
electrode technique.
The accuracy predictions of the three ions in the on-site
measurement task were considerably high. Although slightly
lower than those of the training stage, the results showed that
the AMSAM developed by low-cost and straightforward
components (such as, a Lab 3D printed sensor chamber and
a low-cost peristaltic pump (pump A), etc.), was still efficient for
developing an affordable and applicable SDT architecture.
Fig. 10 illustrates the characteristics of the pump-based sample
Table 7 A comparison of the predicted quality of the proposed models with the real hydroponic solution tests
Considered Ions
Range of concentration
(mg L <sup>�1</sup> ) Models Accuracy (RMSE, mg L <sup>�1</sup> ) Precision (CV <sup>a</sup>,%)
Calcium 150 to 250 DKL1 29.2 8.9
DKL2 17.9 8.8
DKL3 12.4 4.1
DKL4 19.3 9.2
DKL5 25.1 11.2
Phosphate 100 to 200 DKL1 25.7 12.1
DKL2 18.2 9.8
DKL3 12.1 6.2
DKL4 24.1 10.8
DKL5 27.8 26.6
Magnesium 20 to 70 DKL1 17.2 18.1
DKL2 10.5 11.9
DKL3 7.5 9.6
DKL4 11.0 16.3
DKL5 13.8 56.6
f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f f i f
XN
ðy^i � <u>ysÞ</u> <sup>2</sup>
<u>i</u>
CV¼ <sup><u>SD</u></sup>
v
u
u
u
u
t
<u>N �</u> <u>1</u>
- 100 ¼
a
<u>yN</u>
a <u>yN</u>
<u>yN</u> �100 with the standard deviation (SD), the average concentration of samples (�ys), the average concentration of
measurements (�yN), and the number of samples (N).
quantication. Signicant linear relationships were found
between volumes set by the pumps and the standard volume
having small RMSEs of 0.45 and 0.14 mL, CV of 3.1 and 1.2%,
and high R <sup>2</sup> of 0.9986 and 0.9996 for pump A, pump B,
respectively. Furthermore, the results of calcium and phosphate
prediction proved that the automated sampling technique
based on AMSAM contributed signicantly towards the
improvement in the prediction accuracy of the two elements.
Pre-processing based AMSAM-FE eliminated negative factors,
for example, the interferences of ionic strength uctuation, the
matrix background of solution change, <sup>4,14</sup> the variation of EMFs
(i.e. the uctuated potentials of ISEs while moving them from
the sample to the other solutions <sup>32</sup> ). The samples were regulated
Fig. 10 The relationship between the volumes set by pumps and
standard volume.
at �5.0 pH, which facilitated calcium and phosphate ISEs to
work well. The feature enrichment signals furnished extra
information to the DKL model to improve the three ions
prediction accuracies.
The burden of computation was an inherent disadvantage of
the general DKL. <sup>25</sup> Due to this drawback, DKL was not deployed
effectively in the real-time application. On the other hand,
LabVIEW is a powerful graphic (G) language that works well
with data ow architecture, visual programming, parallel processing, and special real-time interface with the semi-nature
system (a system that combines both physical and virtual
equipment). <sup>31</sup> In this study, LabVIEW was utilized to implement
and alleviate the shortcoming of the proposed DKL. Tuning the
hyper-parameters (number of hidden layers, number of nodes
in each layer, etc.) is the most complicated task in developing
the machine learning models. In this experiment, the relationship between the principal components (PCs) of the raw
ISEs' data and the RMSEs of the performed models was evaluated to visualize the models' optimizing targets. That can be
used to reduce the modeling progress's optimization burden. In
general, the fewer the nodes of the last layer of the DNN, the
quicker computation of DKL was. Nevertheless, the number of
neurons in the last layer of the DNN also affected the DKL
performances. Specically in this scenario, the magnesium is
not an available ISEs element. The predicted concentration of
magnesium ion depended on both the available ISEs' signals
(calcium and phosphate). Therefore, in the few PCs case, original magnesium information in the DNN's output data (the GP
input data) may be reduced. That reduces the accuracy of
magnesium prediction (Fig. 5 at PCs ¼ 3). Whereas in the 9-PCs
case, the model performance was not satisfactory either. The
high numbers of PCs mean that the dimensions of given data to
the GP stage were high, affecting the DKL models' accuracies. <sup>4</sup>
The tted PCs were four at which the RMSEs of the models were
minima (Fig. 5b). Moreover, comparing ve DKL structures
supplied the basis to choose the suitable DKL architecture for
the SDT. The DKL1 and DKL2 were constructed with a relatively
small DNN core that allows deploying conveniently and fast.
However, their performances were not satisfactory because they
could not generalize the targets with slightly small data samples
in this scenario. The DKL4 and DKL5 architectures achieved
relatively satisfactory results. Nevertheless, their big DNN core
makes implementing the DKL more complicated and unsuitable for real-time processing requirements. DKL3 was the best
model for the SDT. It was a slightly compactable architecture
160-160-600-4-GP (a 160-160-600-4 neural network and a GP
stage). The DKL3-based SDT was implemented successfully in
LabVIEW platform and worked well with just about 100 milliseconds processing time based on a personal computer (Asus
K401L, CPU core i5 2.7 GHz). The DKL3 core was combined with
an AMSAM sampling module to build up the SDT by which the
three ions (calcium, phosphate, and magnesium) were determined on-site timely.
The tted DKL structure was veried using the lab samples
(Fig. 6) and the real on-site samples (Fig. 9). The performance of
DKL3 was better, linear and with lower errors than the other
models. Specically, the results of the training stage (Fig. 6 and
Table 6) exhibited that DKL3 was the accomplished model for
the SDT, and was trained well with a high coefficient of
performance R <sup>2</sup> (0.99) and a slope (�1.0) for calcium. Although
the big error occurred at the 15 <sup>th</sup> sample (see Fig. 9) by the
draining out of the RE's lling solution, this error could be
Fig. 11 Concentrations of the three ions updated on Thingspeak Web verified SDT feasibility in the field.
eliminated by maintaining the inner solution at a suitable level.
Therefore, the results of SDT with the real on-site sample from
the lettuce hydroponic system were evaluated with 26 samples.
DKL3 was the suitable core with the lowest RMSE of 12.4, 12.1,
and 7.5 mg L <sup>�1</sup> and the lowest CVs of 4.1, 6.2, and 9.6% for
predicting calcium, phosphate, and magnesium, respectively
(Fig. 9, and Table 7). The satisfying results of DKL3 for determining the concentration of the three ions in the real on-site
lettuce hydroponic system proved that DKL-based SDT was
implemented entirely in the LabVIEW platform based on the
regular functions and Virtual Instruments (VIs). DKL-LabVIEWbased SDT results demonstrate that DKL could be deployed
efficiently in the third environment without the complicated
machine learning toolkits.
Moreover, the opened connectivity capability of the proposed
SDT allows to update data (with determined ions concentration)
to cloud computing based on Thingspeak, an open internet of
things (IoT) service (IoBridge, Marlborough, MA, USA). The
growers can access SDT's database from any static or mobile
device (computers or smartphones etc.) via the Web platform.
The posted data from SDT are updated per every 15 seconds of
time. It is entirely applicable for deploying the remote monitoring system, the IoT-based control system in big modern
agricultural projects. SDT can also work well as an intelligent
edge computing supplied diagnosed nutrient information and
plant growth stage for the 4.0 technology-based agriculture
systems. <sup>21</sup> Fig. 11 presents the application of SDT in the lettuce
hydroponic system (Fig. 11a) and the predicted concentration of
the three ions (Fig. 11b).
### 5. Conclusion
We developed a smart diagnostic tool for on-site determination
of three ions concentration in lettuce hydroponic nutrient
solution. The DKL model core of SDT was developed in Python
and implemented in the real-time environment (LabVIEW) to
undertake the real on-site diagnostic tasks. The AMSAM-FE
based acquiring and preprocessing of data and the DKL
model were incorporated for developing the SDT that could
quantify the concentration of calcium, phosphate, and
magnesium on-site. Hardware sampling technique and soware signal processing were applied in combination to improve
the accuracy of the measurements by resolving the disadvantages of ISEs, for example, signal dris, interferences, and ionic
strength. <sup>4</sup>
The AMSAM developed by the low cost and simple components, such as a 3D printed sensor chamber, two electromagnetic valves, a tiny electric pump, and two peristaltic pumps,
effectively sampled and signicantly contributed towards
improving the accuracy of the SDT. Moreover, the DKL model
supported by the MSAM-FE could be modeled satisfactorily with
only 100 Lab-synthesized samples. The SDT structure's feasibility was evaluated in the actual lettuce hydroponic system with
the real hydroponic solution.
The complicated computation of deploying the DKL in the
eld was implemented successfully in the LabVIEW for the rst
time. This exhibits that the DKL can be exploited in solving
problems in on-site ions (Ca, P, Mg) concentrations measurement in the actual hydroponic system. This study also showed
that the three ions were effectively and accurately diagnosed in
real-time by the smart diagnostic tool. The SDT could be used as
a component for automated monitoring of plants nutrients in
a hydroponic system. It could also be employed in smart
sensing that would supply useful information of the three
elements to growers or managers for manipulating the hydroponic system through the cloud computing database of on-site
measurement of these ions. Moreover, this study suggests that
the SDT can be deployed for improving the quality of modern
agriculture based on hydroponics and internet of things (IoT)
backbone.
This approach proved that the DKL could be implemented in
the third environment without the complicated Toolkits or
Libraries. That also paved the way for applying the DKL in a real
system based on low-cost and straightforward hardware and
soware platforms.
The results of the proposed approach were rather good with
RMSE of 12.5, 12.1, and 7.5 mg L <sup>�1</sup> and the CV% of 4.1, 6.2, 9.8
for predicting calcium, phosphate, and magnesium in the range
of 150–250, 100–200, and 20–70 mg L <sup>�1</sup>, respectively. The
accuracy of magnesium prediction was slightly lower than those
of calcium and phosphate. However, in the unavailable
magnesium ISE condition, this approach could still supply
magnesium trace for improving the fertilizer management
efficiency in a real hydroponic system.
### Author contributions
The manuscript was written through contributions of all
authors. All authors have given approval to the nal version of
the manuscript.
### Funding
This work was supported in part by the Liquor Making Biological Technology and Application of Key laboratory of Sichuan
Province (Grant No. NJ2019-02).
### Conflicts of interest
The authors declare no conict of interest.
### Acknowledgements
The authors express their sincere gratitude to the teachers and
students of the College of Information and Electrical Engineering, China Agricultural University, Beijing, China, and of
International Joint Research Center of Aerospace Biotechnology
and Medical Engineering, Beihang University, Beijing, China,
and the technicians of Quality Testing Lab, Center for Research
and Development Science Technology Tien Nong, Thanh Hoa,
Vietnam. for donations in preparing Lab-synthesized samples,
and analyzing the hydroponic samples.
### References
1 H. Zekki, L. Gauthier and A. Gosselin, J. Am. Soc. Hortic. Sci.,
1996, 121, 1082–1088.
2 M. T. Ko, T. I. Ahn, Y. Y. Cho and J. E. Son, Hortic., Environ.
Biotechnol., 2013, 54, 412–421.
3 D. H. Jung, H. J. Kim, W. J. Cho, S. H. Park and S. H. Yang,
Comput. Electron. Agric., 2019, 156, 660–668.
4 T. Vu Ngoc, A. M. Khattak, H. Zhu, W. Gao and M. Wang,
Sensors, 2020, 20, 5314.
5 H.-J. Kim, W.-K. Kim, M.-Y. Roh, C.-I. Kang, J.-M. Park and
K. A. Sudduth, Comput. Electron. Agric., 2013, 93, 46–54.
6 J. Saurina, E. L´opez-Aviles, A. Le Moal and S. Hern´andezCassou, Anal. Chim. Acta, 2002, 464, 89–98.
7 L. Wang, Y. Cheng, D. Lamb, P. J. Lesniewski, Z. L. Chen,
M. Megharaj and R. Naidu, J. Chemom., 2017, 31, e2870.
8 W. J. Cho, H. J. Kim, D. H. Jung, H. J. Han and Y. Y. Cho,
Sensors, 2019, 19, 17.
9 A. C. Wilson and K. H. Pool, Anal. Chim. Acta, 1979, 109, 149–
155.
10 S. A. Glazier and M. A. Arnold, Anal. Chem., 1991, 63, 754–
759.
11 R. Marco and P. Alexander, Anal. Commun., 1997, 34, 93–95.
12 D.-H. Jung, H.-J. Kim, H. S. Kim, J. Choi, J. D. Kim and
S. H. Park, Sensors, 2019, 19, 2596.
13 W. J. La, K. A. Sudduth, H. J. Kim and S. O. Chung, Trans.
ASABE, 2016, 59, 787–794.
14 V. N. Tuan, T. D. Dinh, A. M. Khattak, L. Zheng, X. Chu,
W. Gao and M. Wang, IEEE Access, 2020, 8, 28289–28300.
15 J. Saurina, E. Lopez-Aviles, A. Le Moal and S. HernandezCassou, Anal. Chim. Acta, 2002, 464, 89–98.
16 M. Maj-Zurawska and A. Lewenstam, Talanta, 2011, 87, 295–
301.
17 W. Zhang, L. Jenny and U. E. Spichiger, Anal. Sci., 2000, 16,
11–18.
18 L. Wang, D. Yang, C. Fang, Z. L. Chen, P. J. Lesniewski,
M. Mallavarapu and R. Naidu, Talanta, 2015, 131, 395–403.
19 H. B. Atas, A. Kenar and M. Tastekin, Talanta, 2020, 217,
121110.
20 R. De Marco, B. Pejcic and Z. L. Chen, Analyst, 1998, 123,
1635–1640.
21 ThingSpeak, https://thingspeak.com/, accessed on 8th
October 2020.
22 L. I. Trejo-T´ellez and F. C. G´omez-Merino, in Hydroponics-A
Standard Methodology for Plant Biological Researches,
InTech, 2012.
23 A. Conagin, D. Barbin, S. S. Zocchi and C. G. B. Dem´etrio,
Rev. Bras. Biomet., 2014, 32, 180–189.
24 J. Magalhaes and A. Machado, Analyst, 2002, 127, 1069–1075.
25 A. G. Wilson, Z. T. Hu, R. Salakhutdinov and E. P. Xing, in
Articial Intelligence and Statistics, ed. A. Gretton and C. C.
Robert, Microtome Publishing, Brookline, 2016, vol. 51,
pp. 370–378.
26 C. E. Rasmussen and C. Williams, Gaussian Processes for
Machine Learning, Cambridge, MA, 2006.
27 R. M. Neal, Bayesian learning for neural networks, Springer
Science & Business Media, 2012.
28 N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever and
R. Salakhutdinov, J. Mach. Learn. Res., 2014, 15, 1929–1958.
29 I. Goodfellow, Y. Bengio and A. Courville, Deep learning, MIT
Press, 2016.
30 L. Wang, Y. Cheng, D. Lamb, Z. Chen, P. J. Lesniewski,
M. Megharaj and R. Naidu, Environ. Technol. Innovation,
2016, 6, 165–176.
31 R. Bitter, T. Mohiuddin and M. Nawrocki, LabVIEW:
Advanced programming techniques, CRC Press, 2017.
32 C. C. Rundle, http://www.nico2000.net/Book/Guide1.html,
Consult´e le 14-sept-2013, 2000.
섹션 본문
섹션 본문이 없습니다.
참고문헌 28건
- LabVIEW™ Advanced Programming Techniques CRC Press eBooks · Informa · 2010 10.1201/9781420004915
- Bayesian Learning for Neural Networks Lecture notes in statistics · Springer Nature · 1996 10.1007/978-1-4612-0745-0
- Array of potentiometric sensors for the analysis of creatinine in urine samples The Analyst · Royal Society of Chemistry · 2002 10.1039/b201173e
- Selectivity of membrane electrodes based on derivatives of dibenzyltin dichloride Analytical Chemistry · American Chemical Society · 1991 10.1021/ac00008a003
- Flow injection potentiometric determination of phosphate in waste waters and fertilisers using a cobalt wire ion-selective electrode The Analyst · Royal Society of Chemistry · 1998 10.1039/a801244j
- Application of neural networks with novel independent component analysis methodologies to a Prussian blue modified glassy carbon electrode array Talanta · Elsevier BV · 2014 10.1016/j.talanta.2014.08.010
- Potentiometric behaviour and surface composition of a prototype monohydrogenphosphate-selective electrode Analytica Chimica Acta · Elsevier BV · 1979 10.1016/s0003-2670(01)84238-0
- Automated sensing of hydroponic macronutrients using a computer-controlled system with an array of ion-selective electrodes Computers and Electronics in Agriculture · Elsevier BV · 2013 10.1016/j.compag.2013.01.011
- Determination of calcium and total hardness in natural waters using a potentiometric sensor array Analytica Chimica Acta · Elsevier BV · 2002 10.1016/s0003-2670(02)00474-9
- Selectivity coefficients of ion-selective magnesium electrodes used for simultaneous determination of magnesium and calcium ions Talanta · Elsevier BV · 2011 10.1016/j.talanta.2011.09.023
- A Comparison of Neutral Mg2+-Selective Ionophores in Solvent Polymeric Membranes: Complex Stoichiometry and Lipophilicity Analytical Sciences · Springer Nature · 2000 10.2116/analsci.16.11
- Dropout: a simple way to prevent neural networks from overfitting 2014
- Flow-injection Potentiometric Detection of Phosphates Using a Metallic Cobalt Wire Ion-selective Electrode Analytical Communications · Royal Society of Chemistry · 1997 10.1039/a700771j
- Uptake of nutrients and water by paprika (Capsicum annuum L.) as affected by renewal period of recycled nutrient solution in closed soilless culture Horticulture Environment and Biotechnology · Springer Science+Business Media · 2013 10.1007/s13580-013-0068-0
- Growth, Productivity, and Mineral Composition of Hydroponically Cultivated Greenhouse Tomatoes, with or without Nutrient Solution Recycling Journal of the American Society for Horticultural Science · American Society for Horticultural Science · 1996 10.21273/jashs.121.6.1082
- Hydroponics - A Standard Methodology for Plant Biological Researches InTech eBooks · InTech · 2012 10.5772/2215
- LabView: Advanced Programming Techniques, Second Edition 2017
- Fusion of Spectral and Electrochemical Sensor Data for Estimating Soil Macronutrients Transactions of the ASABE · American Society of Agricultural and Biological Engineers · 2016 10.13031/trans.59.11562
- Simultaneously determining multi-metal ions using an ion selective electrode array system Environmental Technology & Innovation · Elsevier BV · 2016 10.1016/j.eti.2016.10.001
- Novel recalibration methodologies for ion‐selective electrode arrays in the multi‐ion interference scenario Journal of Chemometrics · Wiley · 2016 10.1002/cem.2870
- Artificial Intelligence and Statistics arXiv (Cornell University) · Cornell University · 2017 10.48550/arxiv.1712.03779
- Multipotent Systems: Combining Planning, Self-Organization, and Reconfiguration in Modular Robot Ensembles Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s19010017
- Validation testing of an ion-specific sensing and control system for precision hydroponic macronutrient management Computers and Electronics in Agriculture · Elsevier BV · 2018 10.1016/j.compag.2018.12.025
- Fusion of Spectroscopy and Cobalt Electrochemistry Data for Estimating Phosphate Concentration in Hydroponic Solution Sensors · Multidisciplinary Digital Publishing Institute · 2019 10.3390/s19112596
- Multivariate Standard Addition Cobalt Electrochemistry Data Fusion for Determining Phosphate Concentration in Hydroponic Solution IEEE Access · Institute of Electrical and Electronics Engineers · 2020 10.1109/access.2020.2971143
- An electronic tongue for simultaneous determination of Ca2+, Mg2+, K+ and NH4+ in water samples by multivariate calibration methods Talanta · Elsevier BV · 2020 10.1016/j.talanta.2020.121110
- Combination of Multivariate Standard Addition Technique and Deep Kernel Learning Model for Determining Multi-Ion in Hydroponic Nutrient Solution Sensors · Multidisciplinary Digital Publishing Institute · 2020 10.3390/s20185314
- (제목 없음) Directory of Open access Books (OAPEN Foundation) · 2022 10.7551/mitpress/3206.001.0001