# Intelligent Prediction of Refrigerant Amounts Based on Internet of Things

Authors: Jincai Chang; Qiuling Pan; Zhihao Shen; Hao Qin
Journal: Complexity
 (2020)

---

## Abstract

In a refrigeration unit, the amount of refrigerant has a substantial influence on the entire refrigeration system. To predict the amount of refrigerant in refrigerators with the best performance, this study used refrigerator data collected in real time via the Internet of Things, which were screened to include only the effective parameters related to the compressor and refrigeration properties (based on their practical significance and the research background) and cleaned by applying longitudinal dimensionality reduction and transverse dimensionality reduction. Then, on the basis of an idealized model for refrigerator data, a model of the relationships between refrigerant amount (the dependent variable) and temperature variation, refrigerator compartment temperature, freezer temperature, and other relevant parameters (independent variables) was established. A refrigeration model based on a neural network was then established for predicting the amount of refrigerant and was used to predict five unknown amounts of refrigerant from data sets. BP neural network and RBF neural network models were used to compare the prediction results and analyze the loss functions. From the results, it was concluded that the unknown amount of refrigerant was most likely to be 32.5 g. It is of great practical significance for refrigerator production and maintenance to study the prediction of the amount of refrigerant remaining in a refrigerator.


---

## Body

## 1. Introduction

Against the backdrop of the highly developed state of network technology and the ongoing development of sensor acquisition technology and communication technology, a new type of relationship between objects emerges. In this environment, all objects related to the Internet are connected through radio frequency identification devices (RFIDs) [1], image recognition technology [2], wireless data communication, and other information-sensing technologies, thereby forming a network with certain intelligent identification and intelligent management functions [3], called the Internet of things (IoT). With the rapid development of smart home appliances [4], digital computer technology, information network technology, and sensing technology can be applied to household appliances [5, 6], enabling smart home appliances to generate “thought,” acquire perceptual abilities, and perform information network functions [7]. As smart home appliances in the family continuously exchange information with the outside world, they can help people optimize their lifestyles and use household appliances more conveniently.The combination of IoT with refrigerators to produce the smart refrigerator is an inevitable result of the development of IoT technology and a direct reflection of people’s pursuit of higher quality and a more convenient life [8]. In contrast with the traditional ordinary refrigerator, the smart refrigerator can remind users of foods stored in the refrigerator in a timely way, collect data relevant to the refrigerator’s operation to issue early warnings and to prompt maintenance, and help people use it more easily [9, 10], changing people’s living habits to a certain extent and increasing convenience in people’s lives [11]. Figure 1 shows a diagram of the structure of a smart home appliance system.Figure 1
Diagram of smart home appliance and its relationships.In refrigeration appliances, the cooling effect is affected by many factors. As a fully closed refrigeration system, it is limited by many factors, and compactness of the physical structure is a strict design requirement [12]. Under the condition of close coordination of key components such as the evaporator, capillary [13], condenser, and compressor, the amount of refrigerant has a substantial influence on the entire refrigeration system [14]. With too much or too little refrigerant, the refrigerant cannot be freely converted [15], the internal pressure will be unbalanced, efficiency of the system will be reduced, and energy consumption will increase, resulting in poor refrigeration [16, 17]. Therefore, it is highly important to precisely control the amount of refrigerant, and this necessitates accurate analysis of the system data [18, 19].It is the responsibility of refrigerator manufacturers to maintain the quality of refrigerators, addressing issues such as the normal loss of refrigerant, leakage problems, insufficient or excessive filling in later stages, and the question of how much refrigerant should be added when it is clear that the amount is insufficient. If the problem would affect actual use, prompt maintenance can significantly improve the user experience. However, as frequent on-site inspection is not very feasible, it is important to collect and analyze refrigerator data in real time through the Internet of Things, calculate the amount of refrigerant remaining, and prompt users or manufacturers when it falls to a preset threshold so that they can perform advance maintenance.This study investigated the effect of changes in refrigerant amount on selected parameters such as the refrigerator compartment temperature, variations in temperature, freezing temperatures, and refrigerator frost temperature and established a model of the relationships between refrigerant amount and these parameters, in which the refrigerant amount is the dependent variable and the relevant acquisition parameter is an independent variable. Then, the refrigerant amount was predicted in an experiment by studying the effect of changes in relevant parameters.


## 2. Refrigerator Characteristics

Through the real-time collection of existing refrigerator data through the Internet of Things, it is feasible to estimate the amount of refrigerant remaining in the refrigerator and to add a proper amount of refrigerant, which is important for the production and maintenance of the refrigerator. As the refrigerator structure, operating mechanism, and data acquisition environment have an impact on the collected data, it is necessary to provide a basic description of the type of refrigerator investigated in this study.


### 2.1. Physical Structure and Function

Different physical structures of refrigerators produce different types of data and affect the temperature changes within each chamber. Table1 shows the main physical structure of the refrigerator.Table 1
Physical structure and function of the refrigerator.
Sequence number
Unit
Component
Function
1
Refrigerator compartment
Refrigerator sensor
Senses the temperature and sends the data to the control panel to control the cooling of the refrigeration section
2
Refrigerator defrosting heating element
Defrosts the refrigeration evaporator
3
Refrigerator door
Senses the switch status and sends the data to the control panel to control lights, air doors, fans, and compressor switches
4
Refrigerator defrost sensor
Senses the defrosting temperature and sends the data to the control panel to control the end of the defrosting
5
Refrigerator damper
Controls refrigerator cooling through the damper switch
6
Chilling chamber
Chilling chamber sensor
Senses the temperature and sends the data to the control panel to control the cooling of the chilling chamber
7
Chilling chamber heating element
Heats the chamber, turning on when the storage function of the chamber is set
8
Chilling chamber damper
Controls the cooling of the chamber through the damper switch
9
Variable-temperature compartment
Variable-temperature sensor
Senses the variations in temperature and sends the data to the control panel to control the cooling of the compartment
10
Variable-temperature damper
Controls the cooling of the compartment through the damper switch
11
Freezer compartment
Freezer sensor
Senses the temperature and sends the data to the control panel to control the cooling of the freezer
12
Freezer defrost sensor
Senses the temperature during defrosting and sends the data to the control panel to control whether defrosting is over
13
Freezer door switch
Detects status of door and sends the data to the main control board, thereby controlling lights, dampers, fans, and compressor switches
14
Freezer fan
Supplies air to the compartments
15
Freezer defrosting heating element
Defrosts the freezer evaporator
16
Ballast machine
Compressor
Circulates refrigerant in the system, thereby accomplishing refrigeration


### 2.2. Control Panel

#### 2.2.1. Principle

By adjusting the digital resistance of the analog sensor, various working states of the refrigerator’s computer board can be activated, thereby simulating the process of using the refrigerator.Throughout the experiment, the R-on of the refrigerator compartment was 7 degrees, the R-off was 3 degrees, the change in the temperature of the variable-temperature compartment was 0 degrees (the “keeping fresh” mode), the startup point was 1 degree, the shutdown point was −1 degree; the temperature of the freezing compartment was the same as that of the refrigerator compartment, F-on was −16 degrees, and F-off was −19 degrees. In order to ensure triggering, the corresponding temperature point was 1 degree lower than the OFF point and 1 degree higher than the ON point.By default, the refrigerator runs with a load when a profile is formulated.


#### 2.2.2. Typical Working Activities

(i)
Pull-down mode (boot): when the computer board is charged, the freezer sensor detects whether the temperature is below −5 degrees, and the computer board enters the pull-down mode. Refrigeration, freezing, and temperature variations occur until the shutdown point is reached, at which time the pull-down mode is exited.
(ii)
Thermal insulation refrigeration: if the heat preservation stage compressor is not operating, the temperature will rise. After a period of time, if the refrigerator sensor reaches the start point, the refrigerator fan starts working, and the air door opens. If the freezer sensor reaches the start point, the compressor starts working, the refrigerator fan starts working, and the air door opens. If the refrigerator sensor reaches the freezer shutdown point and the refrigerator sensor does not reach the start point, the compressor stops working.
(iii)
Moisturizing: when the refrigeration compartment is uncooled and the refrigerator defrost sensor detects that the temperature is less than −3 degrees, the moisturizing function is triggered. When the refrigerator defrost sensor detects that the temperature is greater than 3 degrees, moisturizing ends.
(iv)
Opening and closing the door: opening and closing the door simulates the temperature change caused by cold storage and the opening and closing of the freezer. The trigger mechanism is the same as that in the moisturizing mode.
(v)
Defrosting: after booting, the compressor works for 8 h, triggering defrosting, and the defrosting heating element starts to work. During this time, the compressor does not operate, and the temperatures rise. When the defrost sensor reaches a specified temperature, defrosting stops. Defrost recovery mode is entered and cooling starts.
(vi)
Stopped mode: after working for a period of time, the power supply of the computer board is switched off, simulating a loss of power to the user.


## 2.1. Physical Structure and Function

Different physical structures of refrigerators produce different types of data and affect the temperature changes within each chamber. Table1 shows the main physical structure of the refrigerator.Table 1
Physical structure and function of the refrigerator.
Sequence number
Unit
Component
Function
1
Refrigerator compartment
Refrigerator sensor
Senses the temperature and sends the data to the control panel to control the cooling of the refrigeration section
2
Refrigerator defrosting heating element
Defrosts the refrigeration evaporator
3
Refrigerator door
Senses the switch status and sends the data to the control panel to control lights, air doors, fans, and compressor switches
4
Refrigerator defrost sensor
Senses the defrosting temperature and sends the data to the control panel to control the end of the defrosting
5
Refrigerator damper
Controls refrigerator cooling through the damper switch
6
Chilling chamber
Chilling chamber sensor
Senses the temperature and sends the data to the control panel to control the cooling of the chilling chamber
7
Chilling chamber heating element
Heats the chamber, turning on when the storage function of the chamber is set
8
Chilling chamber damper
Controls the cooling of the chamber through the damper switch
9
Variable-temperature compartment
Variable-temperature sensor
Senses the variations in temperature and sends the data to the control panel to control the cooling of the compartment
10
Variable-temperature damper
Controls the cooling of the compartment through the damper switch
11
Freezer compartment
Freezer sensor
Senses the temperature and sends the data to the control panel to control the cooling of the freezer
12
Freezer defrost sensor
Senses the temperature during defrosting and sends the data to the control panel to control whether defrosting is over
13
Freezer door switch
Detects status of door and sends the data to the main control board, thereby controlling lights, dampers, fans, and compressor switches
14
Freezer fan
Supplies air to the compartments
15
Freezer defrosting heating element
Defrosts the freezer evaporator
16
Ballast machine
Compressor
Circulates refrigerant in the system, thereby accomplishing refrigeration


## 2.2. Control Panel

### 2.2.1. Principle

By adjusting the digital resistance of the analog sensor, various working states of the refrigerator’s computer board can be activated, thereby simulating the process of using the refrigerator.Throughout the experiment, the R-on of the refrigerator compartment was 7 degrees, the R-off was 3 degrees, the change in the temperature of the variable-temperature compartment was 0 degrees (the “keeping fresh” mode), the startup point was 1 degree, the shutdown point was −1 degree; the temperature of the freezing compartment was the same as that of the refrigerator compartment, F-on was −16 degrees, and F-off was −19 degrees. In order to ensure triggering, the corresponding temperature point was 1 degree lower than the OFF point and 1 degree higher than the ON point.By default, the refrigerator runs with a load when a profile is formulated.


### 2.2.2. Typical Working Activities

(i)
Pull-down mode (boot): when the computer board is charged, the freezer sensor detects whether the temperature is below −5 degrees, and the computer board enters the pull-down mode. Refrigeration, freezing, and temperature variations occur until the shutdown point is reached, at which time the pull-down mode is exited.
(ii)
Thermal insulation refrigeration: if the heat preservation stage compressor is not operating, the temperature will rise. After a period of time, if the refrigerator sensor reaches the start point, the refrigerator fan starts working, and the air door opens. If the freezer sensor reaches the start point, the compressor starts working, the refrigerator fan starts working, and the air door opens. If the refrigerator sensor reaches the freezer shutdown point and the refrigerator sensor does not reach the start point, the compressor stops working.
(iii)
Moisturizing: when the refrigeration compartment is uncooled and the refrigerator defrost sensor detects that the temperature is less than −3 degrees, the moisturizing function is triggered. When the refrigerator defrost sensor detects that the temperature is greater than 3 degrees, moisturizing ends.
(iv)
Opening and closing the door: opening and closing the door simulates the temperature change caused by cold storage and the opening and closing of the freezer. The trigger mechanism is the same as that in the moisturizing mode.
(v)
Defrosting: after booting, the compressor works for 8 h, triggering defrosting, and the defrosting heating element starts to work. During this time, the compressor does not operate, and the temperatures rise. When the defrost sensor reaches a specified temperature, defrosting stops. Defrost recovery mode is entered and cooling starts.
(vi)
Stopped mode: after working for a period of time, the power supply of the computer board is switched off, simulating a loss of power to the user.


## 2.2.1. Principle

By adjusting the digital resistance of the analog sensor, various working states of the refrigerator’s computer board can be activated, thereby simulating the process of using the refrigerator.Throughout the experiment, the R-on of the refrigerator compartment was 7 degrees, the R-off was 3 degrees, the change in the temperature of the variable-temperature compartment was 0 degrees (the “keeping fresh” mode), the startup point was 1 degree, the shutdown point was −1 degree; the temperature of the freezing compartment was the same as that of the refrigerator compartment, F-on was −16 degrees, and F-off was −19 degrees. In order to ensure triggering, the corresponding temperature point was 1 degree lower than the OFF point and 1 degree higher than the ON point.By default, the refrigerator runs with a load when a profile is formulated.


## 2.2.2. Typical Working Activities

(i)
Pull-down mode (boot): when the computer board is charged, the freezer sensor detects whether the temperature is below −5 degrees, and the computer board enters the pull-down mode. Refrigeration, freezing, and temperature variations occur until the shutdown point is reached, at which time the pull-down mode is exited.
(ii)
Thermal insulation refrigeration: if the heat preservation stage compressor is not operating, the temperature will rise. After a period of time, if the refrigerator sensor reaches the start point, the refrigerator fan starts working, and the air door opens. If the freezer sensor reaches the start point, the compressor starts working, the refrigerator fan starts working, and the air door opens. If the refrigerator sensor reaches the freezer shutdown point and the refrigerator sensor does not reach the start point, the compressor stops working.
(iii)
Moisturizing: when the refrigeration compartment is uncooled and the refrigerator defrost sensor detects that the temperature is less than −3 degrees, the moisturizing function is triggered. When the refrigerator defrost sensor detects that the temperature is greater than 3 degrees, moisturizing ends.
(iv)
Opening and closing the door: opening and closing the door simulates the temperature change caused by cold storage and the opening and closing of the freezer. The trigger mechanism is the same as that in the moisturizing mode.
(v)
Defrosting: after booting, the compressor works for 8 h, triggering defrosting, and the defrosting heating element starts to work. During this time, the compressor does not operate, and the temperatures rise. When the defrost sensor reaches a specified temperature, defrosting stops. Defrost recovery mode is entered and cooling starts.
(vi)
Stopped mode: after working for a period of time, the power supply of the computer board is switched off, simulating a loss of power to the user.


## 3. Data Acquisition, Screening, and Processing

### 3.1. Data Acquisition

There were seven refrigerators: BX001, BX002, BX004, BX005, BX006, BX007, and BX009. Each refrigerator was statically injected with a certain amount of refrigerant at a certain time, for example, the BX001 refrigerator was injected with 35 g of refrigerant on January 24, 2018; 35 g on January 25, 2018; and 42.5 g on March 6, 2018. Each file name included the refrigerator ID, the number of grams of refrigerant, and the data collection document number.By setting up each sensor and collecting data from each one and from the refrigerator computer board, we obtained discrete data for the following parameters at various time points: refrigerator compartment temperature, temperature variation, freezer compartment temperature, freezing temperature, refrigerator defrosting temperature, freezer defrosting temperature, ambient temperature, humidity, refrigerator evaporator outlet temperature, freezer evaporator outlet temperature, compressor outlet temperature, machine input voltage, machine input current, inverter input current, network speed, packet loss rate, working mode, refrigerator fan status, refrigerator damper A status, refrigerator damper B status, refrigerator defrosting status, freezer status, freezer defrosting status, refrigerator solenoid valve status, refrigerator solenoid valve, vertical beam heating element status, storage heating element status, refrigerator lamp status, UV module working status, ozone module working status, refrigerator compartment left-door status, refrigerator compartment right-door status, freezer door status, freezer door lower-door status, refrigerator compartment left-door duration open, refrigerator compartment right-door duration open, freezer door opening time, compressor operation frequency, refrigerator temperature setting, variable-temperature compartment function setting value, storage function setting value, freezer temperature set point, unlock button time stamp, and unlock button duration.A total of 124 TXT files were created, 624 MB each, corresponding to the temperature change data under 10 different refrigerant amounts, as well as five files for prediction.


### 3.2. Data Screening

We established an idealized model of refrigerator data. We assumed that the refrigerator was in a normal state during operation, the refrigerant amount remained stable after addition, and the external environment was stable.We show an analysis of the data collected by each sensor, ignoring the effects of built-in lighting and UV module sterilization on temperature. Parameters such as network speed and the rate of discarding are considered to be independent of the model establishment, and the data on the status of the refrigerator solenoid valve and the working status of the ozone module have little influence on the experiment. Therefore, we selected only the first 11 data items for processing: those from the refrigerator compartment temperature to the compressor outlet temperature.In the refrigerator cooling mode, because the refrigerator is intercooled, the refrigeration principle for each compartment is divided into two types. In the first type, a particular compartment sensor reaches the start point, triggering the compressor to start working; meanwhile, the fan starts working, the damper opens, and the fan blows cold air into the compartment for heat exchange, and refrigeration is achieved. In the second type, the sensor itself cannot trigger the compressor; only the heat exchange between the fan and other chambers can serve to achieve cooling. Since refrigerant is only added to the compressor, and our purpose is to study the changes in various parameters when the refrigerant amount changes; we only study the parameter changes under the first refrigeration principle.During heat preservation, moisturizing, tempering of each compartment, and shutdown of the refrigerator, the compressor stops working, and the temperature of each chamber rises. At this time, any changes in the data have nothing to do with the compressor or the refrigerant. Therefore, we believe that any data changes at this time do not reflect the refrigerant. Naturally, in the door-opening phase, although the compressor continues to work, the decisive factor affecting each chamber is the ambient temperature. The data at this time are also considered irrelevant.Thus, we only select the first refrigeration principle—that is, the data on each chamber through the fan directly exchange heat with the compressor, the nonswitching door stage, and the refrigeration phase of the refrigerator compressor—as the effective data for the next step.


### 3.3. Data Processing

The raw data were preprocessed as shown in Figure2.Figure 2
Data preprocessing steps.After data preprocessing, which reduces the data dimensionality, the data parameters finally selected are shown in Table2.Table 2
Valid data parameters.
Selected data parameters
Refrigerator compartment temperature
Freezer defrosting temperature
Temperature variation
Ambient temperature
Freezer compartment temperature
Humidity
Freezing temperature
Refrigerator evaporator outlet temperature
Refrigerator defrosting temperature
Freezer evaporator outlet temperature
Compressor outlet temperatureThe next step was to scan the database to process the data parameters for repeat values (see Figure3). There are multiple lines of data every second, and the basic data remain constant. In order to reduce data redundancy, the mode value for each parameter in a given second was selected as the parameter value for that second, which reduces the data vertically.Figure 3
Raw data.The data as finally processed are shown in Figure4.Figure 4
Preprocessed data.To visualize the data after processing, box plots were drawn from the data (Figure5), enabling the approximate correlation of the data and general trends to be observed. From the figure, it can be seen that the distributions of data under different amounts of refrigerant are similar. It can also be seen that there is a strong correlation between the refrigerator defrosting temperature and the refrigerator evaporator outlet temperature and between the freezer defrosting temperature and the refrigerator evaporator outlet temperature. Ambient temperature and humidity also have a strong correlation, so the data can be further reduced in dimensionality by removing the three parameters refrigerator evaporator outlet temperature, freezer evaporator outlet temperature, and humidity.Figure 5
Box plots by refrigerant amount: (a) 37.5 g, (b) 40 g, (c) 50 g, and (d) 63 g.
(a)
(b)
(c)
(d)Through data visualization, it was found that the parameters of the 45 g_0806 data set were “abnormal”; the data were distributed around 25°C. By a comparison with the box plots of the previous data, these data were deemed abnormal (see Figure6). In order to improve the accuracy of the model results, the data of this part of the abnormality were eliminated during the postoperation. The data anomaly may have been due to operational errors during data collection.Figure 6
Exception data (refrigerant amount, 45 g).Given the data characteristics and the purpose of the modeling, analysis can be performed from three perspectives: the changes in various parameters after different amounts of refrigerant are placed, the relationship between multiple sets of data collected on the same day but at different times, and the effect of different amounts of refrigerant on different machines. Because of the influence of the quantity of data, for example, one given machine can have data for at most three different amounts of refrigerant (according to the description that the refrigerant is injected only once a day), one machine has at most four sets of data for different times of the day, and different machines do not have the same refrigeration. The amounts of the refrigerant are contrasted. Therefore, the factors influencing different machines and the changes in parameters at different times of the same day were not considered; instead, only the changes in parameters between different amounts of refrigerant were extracted for study.


## 3.1. Data Acquisition

There were seven refrigerators: BX001, BX002, BX004, BX005, BX006, BX007, and BX009. Each refrigerator was statically injected with a certain amount of refrigerant at a certain time, for example, the BX001 refrigerator was injected with 35 g of refrigerant on January 24, 2018; 35 g on January 25, 2018; and 42.5 g on March 6, 2018. Each file name included the refrigerator ID, the number of grams of refrigerant, and the data collection document number.By setting up each sensor and collecting data from each one and from the refrigerator computer board, we obtained discrete data for the following parameters at various time points: refrigerator compartment temperature, temperature variation, freezer compartment temperature, freezing temperature, refrigerator defrosting temperature, freezer defrosting temperature, ambient temperature, humidity, refrigerator evaporator outlet temperature, freezer evaporator outlet temperature, compressor outlet temperature, machine input voltage, machine input current, inverter input current, network speed, packet loss rate, working mode, refrigerator fan status, refrigerator damper A status, refrigerator damper B status, refrigerator defrosting status, freezer status, freezer defrosting status, refrigerator solenoid valve status, refrigerator solenoid valve, vertical beam heating element status, storage heating element status, refrigerator lamp status, UV module working status, ozone module working status, refrigerator compartment left-door status, refrigerator compartment right-door status, freezer door status, freezer door lower-door status, refrigerator compartment left-door duration open, refrigerator compartment right-door duration open, freezer door opening time, compressor operation frequency, refrigerator temperature setting, variable-temperature compartment function setting value, storage function setting value, freezer temperature set point, unlock button time stamp, and unlock button duration.A total of 124 TXT files were created, 624 MB each, corresponding to the temperature change data under 10 different refrigerant amounts, as well as five files for prediction.


## 3.2. Data Screening

We established an idealized model of refrigerator data. We assumed that the refrigerator was in a normal state during operation, the refrigerant amount remained stable after addition, and the external environment was stable.We show an analysis of the data collected by each sensor, ignoring the effects of built-in lighting and UV module sterilization on temperature. Parameters such as network speed and the rate of discarding are considered to be independent of the model establishment, and the data on the status of the refrigerator solenoid valve and the working status of the ozone module have little influence on the experiment. Therefore, we selected only the first 11 data items for processing: those from the refrigerator compartment temperature to the compressor outlet temperature.In the refrigerator cooling mode, because the refrigerator is intercooled, the refrigeration principle for each compartment is divided into two types. In the first type, a particular compartment sensor reaches the start point, triggering the compressor to start working; meanwhile, the fan starts working, the damper opens, and the fan blows cold air into the compartment for heat exchange, and refrigeration is achieved. In the second type, the sensor itself cannot trigger the compressor; only the heat exchange between the fan and other chambers can serve to achieve cooling. Since refrigerant is only added to the compressor, and our purpose is to study the changes in various parameters when the refrigerant amount changes; we only study the parameter changes under the first refrigeration principle.During heat preservation, moisturizing, tempering of each compartment, and shutdown of the refrigerator, the compressor stops working, and the temperature of each chamber rises. At this time, any changes in the data have nothing to do with the compressor or the refrigerant. Therefore, we believe that any data changes at this time do not reflect the refrigerant. Naturally, in the door-opening phase, although the compressor continues to work, the decisive factor affecting each chamber is the ambient temperature. The data at this time are also considered irrelevant.Thus, we only select the first refrigeration principle—that is, the data on each chamber through the fan directly exchange heat with the compressor, the nonswitching door stage, and the refrigeration phase of the refrigerator compressor—as the effective data for the next step.


## 3.3. Data Processing

The raw data were preprocessed as shown in Figure2.Figure 2
Data preprocessing steps.After data preprocessing, which reduces the data dimensionality, the data parameters finally selected are shown in Table2.Table 2
Valid data parameters.
Selected data parameters
Refrigerator compartment temperature
Freezer defrosting temperature
Temperature variation
Ambient temperature
Freezer compartment temperature
Humidity
Freezing temperature
Refrigerator evaporator outlet temperature
Refrigerator defrosting temperature
Freezer evaporator outlet temperature
Compressor outlet temperatureThe next step was to scan the database to process the data parameters for repeat values (see Figure3). There are multiple lines of data every second, and the basic data remain constant. In order to reduce data redundancy, the mode value for each parameter in a given second was selected as the parameter value for that second, which reduces the data vertically.Figure 3
Raw data.The data as finally processed are shown in Figure4.Figure 4
Preprocessed data.To visualize the data after processing, box plots were drawn from the data (Figure5), enabling the approximate correlation of the data and general trends to be observed. From the figure, it can be seen that the distributions of data under different amounts of refrigerant are similar. It can also be seen that there is a strong correlation between the refrigerator defrosting temperature and the refrigerator evaporator outlet temperature and between the freezer defrosting temperature and the refrigerator evaporator outlet temperature. Ambient temperature and humidity also have a strong correlation, so the data can be further reduced in dimensionality by removing the three parameters refrigerator evaporator outlet temperature, freezer evaporator outlet temperature, and humidity.Figure 5
Box plots by refrigerant amount: (a) 37.5 g, (b) 40 g, (c) 50 g, and (d) 63 g.
(a)
(b)
(c)
(d)Through data visualization, it was found that the parameters of the 45 g_0806 data set were “abnormal”; the data were distributed around 25°C. By a comparison with the box plots of the previous data, these data were deemed abnormal (see Figure6). In order to improve the accuracy of the model results, the data of this part of the abnormality were eliminated during the postoperation. The data anomaly may have been due to operational errors during data collection.Figure 6
Exception data (refrigerant amount, 45 g).Given the data characteristics and the purpose of the modeling, analysis can be performed from three perspectives: the changes in various parameters after different amounts of refrigerant are placed, the relationship between multiple sets of data collected on the same day but at different times, and the effect of different amounts of refrigerant on different machines. Because of the influence of the quantity of data, for example, one given machine can have data for at most three different amounts of refrigerant (according to the description that the refrigerant is injected only once a day), one machine has at most four sets of data for different times of the day, and different machines do not have the same refrigeration. The amounts of the refrigerant are contrasted. Therefore, the factors influencing different machines and the changes in parameters at different times of the same day were not considered; instead, only the changes in parameters between different amounts of refrigerant were extracted for study.


## 4. Establishment and Solution of BP Neural Network Model

According to Kolmogorov’s theorem, a three-layer BP neural network with a single hidden layer is sufficient to perform arbitrarily complex function mapping. Therefore, a three-layer BP neural network with a hidden layer was adopted.


### 4.1. Overview of BP Neural Network Model

A list of symbols and their descriptions is shown in Table3.Table 3
Symbol descriptions.
Symbol
Meaning
I
n
Input layer neurons
O
n
Output layer neurons
X
i
Amount of refrigerant corresponding to theith prediction category (i=1,3,5,7)
P
X
i
Percentage of refrigerant amount records corresponding to theith prediction category (i=1,3,5,7)


### 4.2. Neural Network Model for Predicting Refrigerant Amount

Figure7 shows the structure of the BP neural network model.Figure 7
Diagram of model structure.The number of input layer neurons is 11, corresponding to the 11 data parameters. The number of output neurons is 1, corresponding to the unknown amount of refrigerant. For quantitative analysis, the category values for the different refrigerant amounts are sequentially assigned: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The categories corresponding to the specific refrigerant amounts are shown in Table4.Table 4
Categories corresponding to refrigerant amounts.
Amount of refrigerant (g)
Corresponding category
30
0
32.5
1
35
2
37.5
3
40
4
42.5
5
45
6
50
7
55
8
63
9The number of neurons in the hidden layer is set as variablen and is calculated according to the following empirical formula:(1)n=In×On+4+a,where a∈1,10. The number of hidden layer neurons was selected as n∈6,15, and after repeated verification, we let n=12.The tansig transfer function was used from the input layer to hidden layer, and the purelin transfer function was used from the hidden layer to output layer. The training algorithm adopts a nonlinear damped least-squares optimization algorithm with the trainlm function. Regarding training error, the maximum number of cycles was 100, and the error between network training results and training samples could be controlled within1×10−6, so the accuracy requirement was considered to be reached. The learning coefficient was 0.05.


### 4.3. Loss Function

Using 80% of the labeled data as the training set and 20% as the test set, a simple neural network model was selected for training to obtain the loss curve of the model (Figure8). According to the figure, the minimum loss function value of the model training can reach below 0.045.Figure 8
Loss function of model.


### 4.4. Model Result Distribution Table

Table5 shows the prediction result details for five XXg data sets.Table 5
Distributions of category predictions.
Data set
Predicted category
Number of corresponding records
Proportion of records (%)
BX006_XXg_0115_2051
1
1281
73.24
3
140
8.00
5
9
0.51
7
318
18.18
BX006_XXg_0116_1129
1
832
96.63
3
13
1.51
5
15
1.74
BX006_XXg_0116_2316
1
2704
56.20
3
1339
27.83
5
18
0.37
7
749
15.57
BX006_XXg_0117_0716
1
2713
55.67
3
1505
30.88
7
654
13.42
BX006_XXg_0117_1044
1
1325
61.40
3
832
38.55


### 4.5. Visualization of Prediction Results

Five files with unknown refrigerant amounts were preprocessed, the XX data set for an unknown refrigerant amount was predicted by the model generated by training, and the prediction results were processed visually. Then, pie charts were drawn to intuitively display the distributions of different categories (Figure9). As can be seen from the figure, based on the qualitative data for five unknown refrigerant amounts, categories 1 and 3 account for the largest proportion; that is, the corresponding refrigerant may range from 30 g to 37.5 g.Figure 9
Visualization of prediction results.
(a)
(b)
(c)
(d)
(e)


### 4.6. Analysis of Results

There are two explanations for the above results.


#### 4.6.1. Refrigerant Amount Varies Discretely according to the Label Given

For each data set, according to the prediction results, the predicted refrigerant amount having the highest percentage was selected as the optimal refrigerant amount for that data set. Table6 shows the optimal amounts for the above five groups of refrigerants.Table 6
Optimal refrigerant amounts.
Data set
Amount of refrigerant (g)
BX006_XXg_0115_2051
32.5
BX006_XXg_0116_1129
32.5
BX006_XXg_0116_2316
32.5
BX006_XXg_0117_0716
32.5
BX006_XXg_0117_1044
32.5


### 4.7. Future Model Modifications

The temperature variation rule for the original data is segmented cooling. After data cleaning, a breakpoint occurs in the second cooling after each temperature rise. Therefore, the most appropriate data processing method should be applied to the section cooling data as a whole. There has been no internal correlation analysis of data parameters and no specific analysis of the internal correlations of parameters, and the model could also be modified in this regard.


### 4.8. Summary

This section has introduced the BP neural network, defined the symbols, categorized the refrigerant amounts, and then applied the BP neural network to training data, training the generated model to predict the unknown refrigerant amount of XXg data, set refrigerant amount data set, and drawn the following conclusion: The value for the unknown amounts of refrigerants was most likely to be 32.5 g.Next, in order to verify the BP results, an RBF radial basis neural network will be used to make predictions, and the results will be compared.


## 4.1. Overview of BP Neural Network Model

A list of symbols and their descriptions is shown in Table3.Table 3
Symbol descriptions.
Symbol
Meaning
I
n
Input layer neurons
O
n
Output layer neurons
X
i
Amount of refrigerant corresponding to theith prediction category (i=1,3,5,7)
P
X
i
Percentage of refrigerant amount records corresponding to theith prediction category (i=1,3,5,7)


## 4.2. Neural Network Model for Predicting Refrigerant Amount

Figure7 shows the structure of the BP neural network model.Figure 7
Diagram of model structure.The number of input layer neurons is 11, corresponding to the 11 data parameters. The number of output neurons is 1, corresponding to the unknown amount of refrigerant. For quantitative analysis, the category values for the different refrigerant amounts are sequentially assigned: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The categories corresponding to the specific refrigerant amounts are shown in Table4.Table 4
Categories corresponding to refrigerant amounts.
Amount of refrigerant (g)
Corresponding category
30
0
32.5
1
35
2
37.5
3
40
4
42.5
5
45
6
50
7
55
8
63
9The number of neurons in the hidden layer is set as variablen and is calculated according to the following empirical formula:(1)n=In×On+4+a,where a∈1,10. The number of hidden layer neurons was selected as n∈6,15, and after repeated verification, we let n=12.The tansig transfer function was used from the input layer to hidden layer, and the purelin transfer function was used from the hidden layer to output layer. The training algorithm adopts a nonlinear damped least-squares optimization algorithm with the trainlm function. Regarding training error, the maximum number of cycles was 100, and the error between network training results and training samples could be controlled within1×10−6, so the accuracy requirement was considered to be reached. The learning coefficient was 0.05.


## 4.3. Loss Function

Using 80% of the labeled data as the training set and 20% as the test set, a simple neural network model was selected for training to obtain the loss curve of the model (Figure8). According to the figure, the minimum loss function value of the model training can reach below 0.045.Figure 8
Loss function of model.


## 4.4. Model Result Distribution Table

Table5 shows the prediction result details for five XXg data sets.Table 5
Distributions of category predictions.
Data set
Predicted category
Number of corresponding records
Proportion of records (%)
BX006_XXg_0115_2051
1
1281
73.24
3
140
8.00
5
9
0.51
7
318
18.18
BX006_XXg_0116_1129
1
832
96.63
3
13
1.51
5
15
1.74
BX006_XXg_0116_2316
1
2704
56.20
3
1339
27.83
5
18
0.37
7
749
15.57
BX006_XXg_0117_0716
1
2713
55.67
3
1505
30.88
7
654
13.42
BX006_XXg_0117_1044
1
1325
61.40
3
832
38.55


## 4.5. Visualization of Prediction Results

Five files with unknown refrigerant amounts were preprocessed, the XX data set for an unknown refrigerant amount was predicted by the model generated by training, and the prediction results were processed visually. Then, pie charts were drawn to intuitively display the distributions of different categories (Figure9). As can be seen from the figure, based on the qualitative data for five unknown refrigerant amounts, categories 1 and 3 account for the largest proportion; that is, the corresponding refrigerant may range from 30 g to 37.5 g.Figure 9
Visualization of prediction results.
(a)
(b)
(c)
(d)
(e)


## 4.6. Analysis of Results

There are two explanations for the above results.


### 4.6.1. Refrigerant Amount Varies Discretely according to the Label Given

For each data set, according to the prediction results, the predicted refrigerant amount having the highest percentage was selected as the optimal refrigerant amount for that data set. Table6 shows the optimal amounts for the above five groups of refrigerants.Table 6
Optimal refrigerant amounts.
Data set
Amount of refrigerant (g)
BX006_XXg_0115_2051
32.5
BX006_XXg_0116_1129
32.5
BX006_XXg_0116_2316
32.5
BX006_XXg_0117_0716
32.5
BX006_XXg_0117_1044
32.5


## 4.6.1. Refrigerant Amount Varies Discretely according to the Label Given

For each data set, according to the prediction results, the predicted refrigerant amount having the highest percentage was selected as the optimal refrigerant amount for that data set. Table6 shows the optimal amounts for the above five groups of refrigerants.Table 6
Optimal refrigerant amounts.
Data set
Amount of refrigerant (g)
BX006_XXg_0115_2051
32.5
BX006_XXg_0116_1129
32.5
BX006_XXg_0116_2316
32.5
BX006_XXg_0117_0716
32.5
BX006_XXg_0117_1044
32.5


## 4.7. Future Model Modifications

The temperature variation rule for the original data is segmented cooling. After data cleaning, a breakpoint occurs in the second cooling after each temperature rise. Therefore, the most appropriate data processing method should be applied to the section cooling data as a whole. There has been no internal correlation analysis of data parameters and no specific analysis of the internal correlations of parameters, and the model could also be modified in this regard.


## 4.8. Summary

This section has introduced the BP neural network, defined the symbols, categorized the refrigerant amounts, and then applied the BP neural network to training data, training the generated model to predict the unknown refrigerant amount of XXg data, set refrigerant amount data set, and drawn the following conclusion: The value for the unknown amounts of refrigerants was most likely to be 32.5 g.Next, in order to verify the BP results, an RBF radial basis neural network will be used to make predictions, and the results will be compared.


## 5. Establishment of RBF Model and Analysis of Loss Function

According to RBF theory, before implementing the algorithm, the center of the basis function should first be determined, as it can directly affect the time and space used for network training. Second, from the hidden layer to the output layer, the weightw and the bias value b are involved, and these cannot be determined in advance. To address the above problems, the following solutions are proposed for implementation at the beginning of the algorithm:(1)
Determination of the location of the center of the basis function: for a data set with a small quantity of data, when the spatiotemporal complexity (time complexity and space complexity) is not limited, take random points to determine the center of the basis function. For a data set with a large quantity of data, having higher precision requirements and certain requirements on space-time complexity, apply the clustering algorithm to obtain the center of the initial basis function for testing, such as the K-means RBF neural network [20].(2)
Determination of weight and bias values from the hidden layer to output layer of neural network: refer to the BP neural network for reverse error propagation, and updateω and b iteratively.The flow chart and implementation design of this algorithm when used for nonlinear function fitting are shown in Figure10. It can be seen from the figure that when the algorithm is applied to nonlinear neural network fitting, it can be divided into three steps: parameter initialization, network training, and network testing.Figure 10
Algorithm flow chart and implementation design.


### 5.1. Implementation of Algorithm

The RBF neural network for nonlinear fitting is defined as an RBF class. First, the neurons and the numbers of input layers, hidden layers, and output layers are initialized according to the sample data, and the weights and basis function centers are randomly assigned. Then, the forward propagation process is constructed, the Gaussian function is selected in the hidden layer, and weightw is trained by back propagation according to the data. Finally, the test data are brought into the network to obtain the predicted value. Some parameters of the established RBF network are shown in Table 7.Table 7
Some of the RBF parameters.
Parameter
Value(s)
maxCycle
5000
Alpha
0.1
batch_size
50
Label
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
n_hidden
25
n_output
1
Cost function threshold setting
Cost < 0.03


### 5.2. Loss Function Analysis

The loss function adopts the mean square error and runs the RBF neural network. When the number of iterations was set to 500, it was found that the loss function rapidly converges to 8.72 (Figure11). This indicates that the training of the RBF radial basis neural network is not as good as that of the BP neural network for this problem and the parameter values used.Figure 11
Loss function of RBF model.The parameters were adjusted several times, but the results were similar. Therefore, we believe that the RBF model does not successfully extractΔT (temperature variation), the change in temperature over time.


### 5.3. Summary

In order to formulate a basis for comparison with the prediction results obtained by the BP neural network, this section used the RBF radial basis neural network to conduct code design and loss function analysis on the nonlinear fitting problem. The RBF neural network characteristically has the best unique approximation, a quickly converging learning process, good classification capability, multidimensional nonlinear mapping capability, good generalizability, parallel information processing capability, and a simple and convenient learning algorithm.However, the network still has the disadvantage of uncertain parameters, and a training process for adjusting parameters is required for different data sets. In this practical application, the RBF neural network was not as effective as the BP neural network for feature extraction of numerical changes. Therefore, the BP neural network is to be preferred when encountering a similar problem.


## 5.1. Implementation of Algorithm

The RBF neural network for nonlinear fitting is defined as an RBF class. First, the neurons and the numbers of input layers, hidden layers, and output layers are initialized according to the sample data, and the weights and basis function centers are randomly assigned. Then, the forward propagation process is constructed, the Gaussian function is selected in the hidden layer, and weightw is trained by back propagation according to the data. Finally, the test data are brought into the network to obtain the predicted value. Some parameters of the established RBF network are shown in Table 7.Table 7
Some of the RBF parameters.
Parameter
Value(s)
maxCycle
5000
Alpha
0.1
batch_size
50
Label
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
n_hidden
25
n_output
1
Cost function threshold setting
Cost < 0.03


## 5.2. Loss Function Analysis

The loss function adopts the mean square error and runs the RBF neural network. When the number of iterations was set to 500, it was found that the loss function rapidly converges to 8.72 (Figure11). This indicates that the training of the RBF radial basis neural network is not as good as that of the BP neural network for this problem and the parameter values used.Figure 11
Loss function of RBF model.The parameters were adjusted several times, but the results were similar. Therefore, we believe that the RBF model does not successfully extractΔT (temperature variation), the change in temperature over time.


## 5.3. Summary

In order to formulate a basis for comparison with the prediction results obtained by the BP neural network, this section used the RBF radial basis neural network to conduct code design and loss function analysis on the nonlinear fitting problem. The RBF neural network characteristically has the best unique approximation, a quickly converging learning process, good classification capability, multidimensional nonlinear mapping capability, good generalizability, parallel information processing capability, and a simple and convenient learning algorithm.However, the network still has the disadvantage of uncertain parameters, and a training process for adjusting parameters is required for different data sets. In this practical application, the RBF neural network was not as effective as the BP neural network for feature extraction of numerical changes. Therefore, the BP neural network is to be preferred when encountering a similar problem.


## 6. Conclusions

Different amounts of refrigerant will produce different temperature change data. After data cleaning and pretreatment, a model was established and trained to obtain a model that can predict refrigerant amount according to changes in temperature. Using this model, the relation between refrigerant amount and relevant parameters (temperature variation, cold storage temperature, etc.) can be established, in which the amount of refrigerant is the dependent variable, and the relevant collection parameters are independent variables. The amount of refrigerant can be predicted by studying the changes in relevant parameters through experiments. In this experiment, it was found that the unknown amount of refrigerant was most likely 32.5 g.In practical production and in life, this model can be used to predict the amount of refrigerant in refrigerators with the best performance and to test and properly maintain refrigerators that have been sold or whose refrigerant needs replenishing.



---

*Source: 1743973-2020-02-03.xml*