Optimization of the Medical Service Consultation System Based on the Artificial Intelligence of the Internet of Things

Artificial intelligence-assisted diagnosis systems are developing rapidly, but doctors are currently less aware of artificial intelligence-assisted diagnosis systems. Understanding how to allow doctors to accept and use artificial intelligence medical assistant diagnosis system can promote the implementation of artificial intelligence medical assistant diagnosis system applications. Taking into account the current difficulties faced by the Internet of Things medical consultation services, this paper proposes a business operation model based on multi-party participation and sharing of medical consultation resources. We designed the information flow, overall logic and service implementation process of the service model, and completed the construction of the artificial intelligence medical service service model. We combine IoT technology to build a vital signs monitoring environment and clarify how to use IoT devices. In the error backpropagation algorithm, there is no significant difference in the contribution of different samples to the weight change, which makes the adjustment of network parameters not easily affected by difficult medical consultation samples, thereby weakening the effect of network medical consultation. In order to solve this problem, this article defines the degree to which the sample belongs to its correct category as the confidence of medical inquiry, and divides the training sample into a dangerous sample and a safe sample according to a dynamic threshold. Based on the difficulty of medical inquiry, an improved new learning algorithm is proposed. The algorithm penalizes the loss of dangerous samples, so that the convolutional neural network pays more attention to dangerous samples and can learn more effective information. Aiming at the eight physiological characteristics of data, this paper adjusts the structure of the convolutional neural network to make it take into account the richness of data characteristics and the dynamics of data changes over time. The realized CNN optimization algorithm model has improved the prediction effect, and the accuracy rate of medical consultation reaches 90.15%, which is better than other machine learning algorithms.


I. INTRODUCTION
With the development of artificial intelligence technology, the application of artificial intelligence in traditional industries continues to expand. In the medical and health industry, the application scope of artificial intelligence involves many sub-fields such as medical records, prevention, diagnosis, and treatment [1], [2]. Among them, ''artificial intelligence + The associate editor coordinating the review of this manuscript and approving it for publication was M. Shamim Hossain . assisted diagnosis'' is one of the most commonly used application scenarios of artificial intelligence in the medical field. The artificial intelligence-assisted diagnosis system is an ''intelligent medical assistant'' that is developed based on artificial intelligence theory and can assist doctors in diagnosis and decision-making such as focal area positioning, disease screening, and treatment plan selection [3]. A successful artificial intelligence-assisted diagnostic system can have diagnostic capabilities equivalent to the level of experts. The development of artificial intelligence medical auxiliary VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ diagnosis systems is entering a white-hot stage, but there is still a long way to go before the general practicality of artificial intelligence medical auxiliary diagnosis systems in the medical industry. On the one hand, the immaturity of related technologies and the non-standardization of data hinder the practical process of the system. Medical diagnosis is linked to the life safety of patients. As an emerging auxiliary diagnosis and treatment technology, the artificial intelligence medical auxiliary diagnosis system is difficult to easily gain the trust of medical workers, and the system can be used in actual work with confidence [4].
The black box problem of artificial intelligence technology makes the internal operation process of the system unclear, and doctors cannot obtain the explanation of the reason between the input data and the output data, which makes it easier to doubt and distrust the system, which is not conducive to the application of the system [5]. Therefore, how to attract doctors to accept and use the artificial intelligence medical assistant diagnosis system is one of the important problems that need to be solved to promote the application of artificial intelligence medical assistant diagnosis system. At present, the development of artificial intelligence-assisted diagnosis system is still in the early stage of exploration [6]. The user experience of the intelligent auxiliary diagnosis system cultivates potential system users and promotes the application of artificial intelligence auxiliary diagnosis system [7]. At the same time, promoting doctors to accept and use artificial intelligence-assisted diagnosis technology is significant for accelerating the in-depth integration of artificial intelligence and the medical field, promoting the development of artificial intelligence medical-assisted diagnosis and treatment technology and product application, and stimulating the economic development of the artificial intelligence industry [8]- [10].
Based on the current problems faced by the Internet of Things consultation services, this article clarifies the multi-party cooperation relationship in the service process, and based on the actual situation of the current consultation service market, proposes a multi-party participation based on the sharing of medical consultation resources. On this basis, the functions and associations of the participating roles in the service model are defined, and then the information flow, overall logic and service specific implementation process of the service model are designed. Specifically, the technical contributions of this article can be summarized as follows: First: We complete the construction of the artificial intelligence medical service service model, and build the Internet of Things monitoring environment. The use of equipment and data collection methods based on the Internet of Things technology are clarified, and the E-R database model is designed to define the database storage mode. This lays a good foundation for the subsequent intelligent function design of the Internet of Things based on data mining technology, and improves the accuracy and timeliness of service implementation.
Second: For the convolutional neural network learning algorithm based on the difficulty of medical consultation, we describe in detail the relevant content of the convolutional neural network, which covers its basic network structure and error back propagation algorithm. We introduced the motivation of the need to improve the learning algorithm of convolutional neural network, and explained the rules of dividing similar samples into dangerous samples and safe samples according to the degree of difficulty of medical inquiry. We not only proposed a new loss function, but also introduced in detail the specific steps of the convolutional neural network learning algorithm based on the difficulty of medical inquiry.
Third: This article uses a convolutional neural network algorithm to train the network using eight kinds of physiological characteristic data to realize the prediction of medical consultations for patients with diseases. Experiments on the MIMIC II database are used to evaluate the results of the experiment with five indicators: sensitivity, specificity, precision, negative precision, and accuracy. Compared with the other six machine learning medical consultation methods, the CNN optimized algorithm model has a certain improvement in the prediction effect, and the accuracy rate of medical consultation has reached 91.5%. This article introduces the improvement of convolutional neural network into the field of physiological information processing, which will play an important role in the application of medical information analysis.

II. RELATED WORK
The use of medical information technology has become an important way to improve the level of medical services and medical quality [11]. In order to discover the key factors that influence the adoption of medical information technology and its related applications by adopters, so as to promote the use and promotion of medical information technology, a large number of researchers have carried out research on the influencing factors of medical information technology adoption based on theories such as technology adoption behavior [12], [13]. The medical information technology adopted in the research mainly includes medical information systems and services such as clinical information systems, mobile medical treatment, electronic medical records, and electronic health records. According to the different subjects (users) adopting the survey, medical information technology adoption research can be divided into three categories: medical institutions, patients, and medical staff [14]. Among them, patients and medical staff are the main research objects of researchers [15].
In the research on the adoption of medical information technology with patients as the main body of adoption, researchers mainly carry out corresponding research on the level of personal and product characteristics [16]. Researchers took the elderly as the main body of adoption and established an adoption model based on the theory of technology adoption and integration, which added two factors, technology anxiety and resistance to change, to study the key factors that affect elderly users' adoption of mobile health services [17]. Related scholars study the influence of service characteristics and other related factors on mobile health consumers' use intention and behavioral interaction [18]. The service characteristic factors include: service matching, service capability and service relevance of mobile health. In order to better study the key factors that affect consumers' willingness to use mobile health services, related scholars have used a hybrid method combining partial least squares and fuzzy set qualitative comparative analysis to develop a model based on the theoretical model of technology adoption and integration [19], [20].
Compared with the single-modal method, the multi-modal data analysis method has stronger data processing ability, can mine the relationship between different modal information, and is easier to improve the model effect [21]. Therefore, considering the advantages of the multi-modal data analysis method, researchers apply it to the field of auxiliary diagnosis and decision-making [22]- [24]. Related scholars use the deep Boltzmann machine to extract and fuse the two image information of magnetic resonance imaging and positron emission tomography to obtain high-quality shared feature representations for Alzheimer's disease screening [25]. Related scholars have designed a new Alzheimer's disease diagnosis framework based on magnetic resonance imaging and positron emission tomography data [26]. The framework uses a zero-masking strategy to extract complementary information from multiple modal data. In particular, researchers have proposed a multi-core learning method for the diagnosis of Alzheimer's disease. This research is more comprehensive than the above two research considerations. It integrates high-dimensional magnetic resonance imaging and other multi-modal image data and genetic data into the diagnosis and analysis of Alzheimer's disease, achieving better information complementation and enhancement [27].
The research on technology adoption behavior in the medical field can be divided into three categories according to the different subjects of adoption [28]. They are medical service recipients (such as patients or people willing to receive medical services), medical staff (doctors, radiologists, etc.), and medical institutions ( Hospitals, clinics, etc.). For different adopters, the factors that affect technology adoption behavior in the medical field are changing. For example, in the formation of technology adoption behavior in the medical field, medical service recipients are more concerned about the impact of this medical field technology on the improvement of their own physical conditions, and for medical staff, they give more consideration to this medical field [29]. Relevant scholars have confirmed the moderating effect of the patient's health status on the quality of online health consultation services and patient satisfaction in the research on the influencing factors of online medical service patient satisfaction [30]. The researchers combed and analyzed the research literature on the adoption behavior of technical doctors in the medical field by medical staff, and proposed that factors related to the working environment and workload have a significant impact on the adoption behavior of technical doctors in the medical field [31]. For medical institutions, they take more into consideration factors such as hospital characteristics, senior management support, and government policies. In addition, in medical service adoption research on specific adoption themes, many researchers tend to conduct medical consultations with respondents based on certain characteristics to more accurately describe their adoption behavior [32]. Relevant scholars use gender as a moderator to study the differences in mobile medical service adoption behavior among different gender groups [33]. Research shows that men have a more positive attitude towards adopting mobile medical services [34].
Relevant scholars established an evolutionary game model for patients receiving medical services from professional doctors in tertiary hospitals through telemedicine technology, and analyzed the influence of different strategy choices of doctors and individual patients on the final game equilibrium strategy selection of the group in the process of medical service [35]. According to whether the hospital uses telemedicine technology in the medical service process of patients, the researchers constructed a game model for the choice of patients and hospitals, and analyzed in-depth analysis of the introduction of telemedicine technology in community hospitals, and the choice of hospitals for patients in the area [36]. Relevant scholars conducted a set of controlled experiments based on whether telemedicine technology was used in the rehabilitation of children's diseases [37]. Through analysis, they found that the use of telemedicine technology can help children recover from diseases to a certain extent. During the study of the rehabilitation process of patients undergoing coronary artery bypass surgery, the researchers conducted a comparative analysis of whether the patients used online medical health management methods, and found that online medical health management methods can guide the life of patients with high coronary artery bypass surgery [38]- [40].
Because the amount of data in the medical database is very large, it is very difficult to dig out effective information from such a large amount of data. If you use traditional data processing methods, you need to spend a lot of manpower and material resources. The development of big data and machine learning technology provides the possibility for rapid and accurate data mining. The Internet of Things artificial intelligence technology has brought new vitality to medical care. In some cases, computer-based assisted diagnosis is considered to be more accurate than clinicians. The use of this technology in medical applications may reduce costs, time, medical errors, and the need for human expertise.

III. SERVICE SYSTEM DESIGN OF ARTIFICIAL INTELLIGENCE MEDICAL SERVICE CONSULTATION SYSTEM BASED ON INTERNET OF THINGS TECHNOLOGY A. DESIGN OF SERVICE OPERATION MODE OF ARTIFICIAL INTELLIGENCE MEDICAL SERVICE CONSULTATION SYSTEM
When patients are transformed from the service goals of medical consultation service institutions to the leader of the consultation service market, the medical consultation VOLUME 9, 2021 service industry can show stronger vitality and adaptability. By deconstructing and reshaping the value chain, this paper proposes a business operation model based on multi-party participation and sharing medical consultation resources. The main participants include patients, consultation service platforms and service providers (institutions, personnel), APP stores and other third-party organizations. Service participants need to maintain effective communication to ensure the operability and scalability of services and products. The service needs of patients and the scheduling of the consultation service platform play a pivotal role. The close cooperation of the service platform is a key aspect of the business model operation. Third-party organizations can share the existing network infrastructure with the consultation service platform without having to build additional facilities on their own; on the other hand, the consultation service platform can provide services from the consultation service platform. Providers can obtain more information on Internet of Things consultation services, realize multi-party information sharing, and ensure service quality and accuracy. In addition to service charges and government funding in terms of operating income, the consultation service platform can cooperate with advertising promoters, APP store and related media. The platform provides advertising spaces and publicity services for the consultation service products of authorized advertisers on the official website, WeChat public account and mobile APP, and charges corresponding advertising fees.
In terms of operating expenses, in addition to the employment costs and facility costs for service personnel and institutions, the platform will list the platform APP in the APP application store, and the APP store will push the download to the user, and the platform will pay a certain amount of listing fee. At the same time, the platform will also support promotion fees for mainstream social software, popular websites and TV programs, conduct service promotion, and tap potential users. The business operation model is shown in Figure 1.

B. ESTABLISHMENT OF SERVICE ARCHITECTURE OF ARTIFICIAL INTELLIGENCE MEDICAL SERVICE CONSULTATION SYSTEM 1) SERVICE INFORMATION FLOW DESIGN
The gradual maturity of technologies such as the Internet of Things and data analysis has provided technical support for the development of intelligent Internet of Things consultation services, and has also put forward higher requirements for collaboration and cooperation between service participants. However, in a service model with a large number of participants and a relatively complex implementation process, the problem of slow or incorrect delivery of service information is prone to occur. Once these problems occur, they will directly lead to failures in the collaboration between service providers, and even cause problems with patients. The conflicts between and their children have harmed the interests of all parties. Therefore, this article designs the information flow of the AI medical service-type Internet of Things consultation service model based on the Internet of Things technology, and activates the information circulation system and improves the Internet of Things consultation service through the integration of the data access layer, the business layer and the user layer.
In the data access layer, the information of all participants in the service model is stored in the cloud server in the form of government registration, medical institution collection, IoT device records, and electronic health file records. The backend service personnel provide services according to the needs of patients. The party's feedback will send service information to service sub-platforms such as housekeeping services, medical health, and catering services. In the business layer, the sub-platform improves its own business processes and schedules services based on service scheduling information. At the user level, dispatching information and related service information are sent to service providers and patients through mobile applications, official websites, portable devices, etc., to implement daily disease early warning and diagnosis and treatment, health lectures, care services and other Internet of Things consultations service. The information flow diagram clarifies the layer-by-layer transmission direction of service information and data processing methods in the service model, which can help service providers to rationally allocate medical service resources and ensure the stable and efficient operation of the business model.

2) SERVICE OVERALL LOGIC DESIGN
The Internet of Things consultation service platform is useroriented. The health and medical service functions meet the needs of patient care, psychological counseling and medical consultation, and at the same time carry out medical collaboration with medical institutions to provide patients with more comprehensive medical services. The function provides users with daily cleaning, organization of activities, daily care and other services; the living food service function can meet the user's living and eating needs, and cooperates with related distribution agencies to achieve three meals door-to-door delivery; the background service function is in addition to managing the patient's medical care. Health and life data also play a role in disease risk prediction and service quality management. The service model of the Internet of Things consultation service platform is shown in Figure 2.

C. CONSTRUCTION OF IoT MONITORING ENVIRONMENT
Compared with the traditional indicator monitoring method, the subcutaneous or skin surface collection method can collect the patient's physical sign data in real time, and monitor the patient's physical health in a more timely manner. The process of implanting the subcutaneous continuous dynamic detection system only takes 2 minutes. The device can transmit dynamic monitoring data to the supporting APP. If the patient has health problems, professional inspection and treatment can be carried out in time according to the actual situation. If the mobile phone is turned off or there is no signal, the device can also vibrate and sound an alarm.  The subcutaneous or skin vital signs collection technology is designed to monitor the risk of common chronic and major diseases in the elderly, and to monitor and visualize dynamic data for diabetes, disease, stroke and other diseases. In order to reduce the risk of disease, intervene risk factors in advance to provide a reference basis. The subcutaneous vital signs collection technology is based on the micro-enzyme electrode method to detect the blood glucose level. Based on the principle of chemical reaction, glucose oxidase is fixed on the sensor electrode, and the electrochemical measuring enzyme catalyzes the decomposition of glucose to generate redox reaction current. This obtains the concentration of glucose. The current blood sugar level can be calculated by the reaction degree after the enzyme interacts with the glucose molecule.
The subcutaneous vital signs acquisition technology can perform timing measurement of the patient's blood glucose, blood pressure, blood lipids and other indicators. The measurement module is placed in the subcutaneous vital sign sensor. The sensor sends the monitoring data to the analysis software and converts it into corresponding indicators. The module sets the time according to the user's living habits to measure the fasting blood glucose two hours after the three meals and the blood glucose before going to bed; the blood pressure measurement module mainly tests the user's multiple blood pressure values throughout the day. The general test interval is 12-18 minutes; the blood lipid measurement module uses reaction inhibitors and reaction enhancers to measure successively. The measurement results mainly include total cholesterol in the blood, Triglycerides, steroids, low-density lipoprotein cholesterol and high-density lipoprotein cholesterol levels, etc. The data measured by the above three modules are uploaded to the cloud database through internal sensors, providing a good foundation for the implementation of the health warning mechanism of the data analysis algorithm. VOLUME 9, 2021 For newly registered patients, service personnel will record their basic information and past medical history through standard health files and will conduct regular follow-ups to update the data. The main content of the health file includes the past medical history and related diagnosis records of age, gender, diabetes, disease, heart disease and other diseases. The health file is divided into two parts: disease diagnosis and treatment and consultation service. The disease diagnosis and treatment part mainly records the patient's basic information, daily life habits, past medical history, diagnosis and medication. The consultation service part mainly records the service items, diet, exercise and fitness, rehabilitation physiotherapy and psychological counseling that the patient applies for.
This article uses sql statements to transform the conceptual model of the database into a data relational model. There are many design models for the conceptual structure of the database. The most widely used model is the ER model. The ER model is independent of the logical model, easy to master, and easy to draw. The advantages can also clearly depict the types of data stored in the database, which are manifested through entities and their attributes, as well as the contact methods between different entities. Therefore, this article uses the E-R model to design the database. In order to make data retrieval more convenient, the main data entities in this article are all related to each other in a many-to-many form. According to the design of the role of the participants of the service platform, the database ER model includes nine entities such as users, medical personnel, and domestic service personnel. Each entity has its corresponding detailed attributes to facilitate data storage and retrieval. The entity is represented by a light purple rectangle; the primary key of each entity is identified by a light gray ellipse, and the attribute is represented by a dark blue ellipse; the cooperation relationship of each entity is represented by a dark gray diamond. The technical architecture of the Internet of Things is shown in Figure 3.

IV. CONVOLUTIONAL NEURAL NETWORK OPTIMIZATION ALGORITHM BASED ON THE DIFFICULTY OF MEDICAL INQUIRY A. CONVOLUTIONAL NEURAL NETWORK MODEL
When the convolutional neural network is trained, the output probability distribution of the network is constantly changing, and whether the output probability distribution can be changed to be basically consistent with the expected probability distribution is mainly affected by the distribution of difficult classification samples. Only when the distribution of difficult-to-classify samples keep getting closer to the category they belong to, the change in the probability distribution is more meaningful. Therefore, it is necessary to treat samples differently according to their classification difficulty during network training. At the same time, due to the uniqueness of the ReLU activation function, it is often easy to make the network structure sparse, which also reminds that the adjustment of network parameters requires more attention to the extraction of information from training samples, especially samples that are difficult to classify. The most commonly used learning algorithm for convolutional neural networks is the BP algorithm, which uses the error of the training set to reversely adjust the weights and thresholds in the network. The BP algorithm treats all samples in the training set equally when calculating the error, and does not strengthen the learning of difficult-to-classify samples more prominently. Therefore, we propose a convolutional neural network learning algorithm based on the difficulty of classification to strengthen the influence of these difficult-to-classify samples on the adjustment of network parameters.
Convolutional neural network is a multi-layer feedforward neural network that introduces convolution operations, and is often used to process image data and audio data. The biggest highlight of the convolutional neural network is that it eliminates manual feature selection. It has effectively combined the automatic feature extraction process with the learning medical consultation process. The image feature extraction is mainly based on the convolution kernel with shared weights, so that the extracted features can better reflect the inherent correlation between the data, and can penetrate deep features.

1) NETWORK STRUCTURE
Many different CNN models have been derived from the development of convolutional neural networks. With the application of convolutional neural networks in different fields, a series of CNN models have emerged, such as AlexNet, VGGNet, GoogleNet, and ResNet. But the basic structure of these models is the same, including the input layer, convolutional layer, pooling layer, fully connected layer and output layer, as shown in Figure 4.
The convolutional layer is usually connected behind the input layer or the pooling layer, and each convolutional layer  contains many convolution kernels of the same size, and each convolution kernel performs a convolution operation with the input image to extract the image. In addition, the features extracted by the convolution kernel are more abstract and distinguishable in the convolutional layer at the lower position.
Convolution operation is the core operation of convolutional neural network, and its operation diagram is shown in Figure 5. The 3 × 3 convolution kernel takes the upper left corner of the 5 × 5 input image as the starting position, multiplies it one by one with the corresponding input matrix data, and then sums it up. Subsequently, the convolution kernel slides from left to right or from top to bottom on the image. Since the stride of the convolution is set to 1, a convolution operation is performed for each grid sliding. Finally, after 9 convolution operations, the convolution output is obtained.
In order to better learn the non-linear feature information hidden in the image, the input image needs to go through a non-linear activation function after being processed by the convolution kernel of the current layer to obtain its corresponding feature map. The entire process of image processing by the convolutional layer can be shown in mathematical expressions. The specific calculation formula is as follows: Among them, f is the activation function, x(j,l) represents the jth feature map of the lth layer, k(j,l) represents the jth convolution kernel, Mj represents the set of feature maps for convolution operation with kjl, and bjl represents the lth layer.
The pooling layer is mainly to perform pooling operations on the feature maps, that is, to map the extracted image feature maps to a smaller plane range. This not only simplifies the network structure and reduces network parameters, but also makes the network less sensitive to image rotation, scaling, or other forms of distortion. The expression of the pooling layer is: The network converts the obtained two-dimensional feature map into a one-dimensional vector and sends it to the fully connected layer. The structure of the fully connected layer is similar to the hidden layer of the traditional neural network, and the fully connected method is implemented between layers. This layer is mainly to organize the learned characteristic information and realize the function of medical inquiry.
In the medical inquiry task, the output layer is mainly used to obtain the possibility of the input image being divided into various categories, and select the most likely category as the final medical inquiry result. The number of neurons in this layer is usually the same as the number of categories, but in the second medical consultation, the number of neurons can be simply set to one, so that the output of the network can be expressed as: Among them, the network output value y is in the interval (0, 1), which is obtained through the transformation of the Sigmoid activation function. At the same time, y also represents the probability that the input image belongs to the positive class. If y>0.5, the input image is classified as the positive class, otherwise, the sample is classified as the negative class. The Softmax function has a normalization function, which can map each element of the vector WX to the interval (0, 1), and the sum of all elements is equal to 1; Y is VOLUME 9, 2021 the actual output vector obtained after the input image passes through the network, where yj represents the probability that the image belongs to the jth class, and the input image will be classified into the class with the largest probability value, that is, if the largest element in the vector Y is yj, the input image is classified into the jth class.

2) ERROR BACK PROPAGATION ALGORITHM
The essence of the error back propagation algorithm is to propagate the error in the opposite direction of the network, and then adjust the training parameters of each layer of the network in the direction of the negative gradient of the error according to the gradient descent method, so that the actual output of the network is closer to the expected output, which minimizes the loss function of the network. The entire process of network training is a process of constant updating of parameters, and the optimal parameters obtained after training can better represent the implicit correspondence between input and output.
The process of error back propagation algorithm used to train convolutional neural network can be roughly divided into two links. The first link is to pass data information into the network and calculate the error obtained by the network; the second link is to calculate the error in reverse. In order to calculate the partial derivative of the parameter more conveniently, the error sensitivity γ of each layer of the network can be calculated first, and then the partial derivative of the corresponding parameter can be obtained by using the chain rule. Among them, the error sensitivity of each layer of the network refers to the partial derivative of the error E for all inputs u of the layer of the network, and its expression is as follows: The mean square error function E is used to calculate the error between the actual output y of the network and the expected output t. The specific formula is as follows: Among them, c represents the dimension of the vector.

B. MOTIVATION OF LEARNING ALGORITHM IMPROVEMENT
In the training of convolutional neural networks, the mean square error function and the cross-entropy loss function are often used to calculate the error of the training set in the second-medical consultation and the multi-medical consultation, respectively. The form of the cross entropy loss function is as follows: Among them, n represents the total number of samples, and Ti is the expected output vector of the i-th sample.
The commonly used loss function calculates the error of all samples in the same way, and the weights of all samples are also the same. However, in network training, not all samples are equally important to the network. Among them, samples that are prone to medical inquiry errors and samples that are correct in medical inquiry but are not highly accurate in medical inquiry require the network more. The adjustment of network parameters should also be more affected by these samples.
In order to describe the motivation of the algorithm improvement more clearly, that is, it is necessary for the network to strengthen the learning of samples of medical inquiry errors and samples of medical inquiry that are correct but not high in accuracy during the training process. The following is the second medical inquiry. In the second medical inquiry, the medical inquiry boundary is generally set to 0.5, and the target values of the negative and positive types are 0 and 1, respectively. If the actual output value of the sample is less than 0.5, it is classified as a negative type; otherwise, it is classified as a positive type. There may be a negative sample in the training process. Although it can be correctly medically questioned, its actual output value iy is closer to the medical questioning boundary 0.5 than the target value of 0. The sample's medical questioning accuracy is not high.

C. SAMPLE DIVISION BASED ON THE DIFFICULTY OF MEDICAL INQUIRY
In order to better describe the degree to which each sample belongs to its target category, this article defines a concept that is the confidence of medical inquiry, and the specific form is as follows: It can be clearly seen from the above formula that the farther the output value yi of the i-th sample is from the target value ti, the lower the confidence of the medical inquiry of the sample.
The core idea of this article is to strengthen the network's learning of samples with low confidence. In order to determine which samples need to be intensively studied, we divide the samples of the same category into dangerous samples and safe samples. Among them, the initial idea of dividing the same type of samples is to set a threshold for the medical inquiry confidence for this category. If the medical inquiry confidence of the sample is less than the threshold, the sample is called a dangerous sample; otherwise, it is called a safe sample. However, the choice of the threshold is very important, its value directly affects the division of samples in the same category. If the threshold is set high, all samples may be considered dangerous samples; if the threshold is set too low, all samples may be considered safe samples. These conditions make the network unable to focus on samples with poor medical consultation, which is no different from common network training methods. In addition, the threshold settings for different training sets should also be different. In short, it is difficult and complicated to determine the threshold value of the medical inquiry confidence in each category in practical application.
Aiming at the problem of the difficulty of obtaining a fixed threshold in the confidence of medical inquiry, we have proposed a dynamic threshold to enable samples of the same kind to be dynamically divided. The form of the dynamic threshold m is as follows: Among them, α i is the average of the actual output values of all samples in the target category of the i-th sample, and r is the total number of samples in the target category of the i-th sample. If the medical inquiry confidence of the sample is less than the dynamic threshold m, the sample is said to have a low confidence, that is, the sample is a dangerous sample. In network training, the dynamic threshold m is continuously adjusted according to the change of the mean value of the actual output value of the sample, which makes the classification of dangerous samples and safe samples in similar samples more flexible and reasonable. The division of similar samples can be expressed in a simpler way. In the second medical consultation, the division of samples of the same category can be expressed as: The i-th dangerous sample in the negative class means that its actual output value y i is greater than the mean α i of the actual output values of all samples in the negative class; and the j-th safe sample in the negative class means that its actual output value yj is less than α j. a0 is the average value of the actual output values of all samples in the negative category. The dangerous samples of the negative category are those samples whose output value is higher than a0. These samples include not only samples with incorrect medical consultations but also samples with correct medical consultations. Also in multiple medical consultations, the division of samples of the same category can be simply expressed as:

D. LEARNING OPTIMIZATION ALGORITHM BASED ON THE DIFFICULTY OF MEDICAL INQUIRY
In order to strengthen the network's learning of dangerous samples, this paper proposes to increase the influence of dangerous samples on the network weight update by appropriately increasing the error of the dangerous samples in the loss function. The increased error means that the actual output value of the dangerous samples is the same as their category. In our proposed learning algorithm based on the difficulty of medical consultation, the new loss function can be written as: Among them, λ is the proportion of the penalty term in the new loss function, and NMSE and NCE are the modified forms of the original loss function MSE and CE, respectively. If λ = 0, the new loss function is the same as the original loss function. At the same time, the impact of the penalty item increases with the increase of the value of λ. If λ = 1, there is only a penalty term in the new loss function. Since the value of the penalty term is very small, if only the penalty term is used to train the network, the network cannot be effectively trained. Therefore, λ cannot take 1, and its value range is [0,1]. The specific process of the learning algorithm of the convolutional neural network based on the difficulty of medical consultation is shown in Figure 6.

V. SIMULATION RESULTS AND ANALYSIS A. DATA PREPROCESSING
The data set is mainly divided into two parts, label and data. The label identifies the type of data subordination. The goal of the algorithm is to pass training, and the correct label can be determined after inputting the data. The higher the accuracy rate, the better the algorithm. There are two types of label settings for the data used in this article, with disease and without disease. These two labels need to be converted so that the computer can easily identify them. One-hot encoding, its encoding method is to use n bits to represent n different states, and each code has and only one bit is valid, which is very suitable for encoding labels. The one-hot encoding of the label is shown in Figure 7.
As for the data part, we select the sample with multiple requirements in the database, download it to the local in.csv format, and obtain the original data set. One of the main steps that affect the prediction performance and quality of machine learning models is data quality and data preprocessing. Therefore, several steps have been applied to deal with some problems on the data set.

1) ZERO AVERAGING
The intake of input information usually does not come from the level of the value, but from the relative value between the values. Zero averaging does not eliminate the relative difference between the values, but only removes the influence of DC information. And too large mean value of the data may also cause the gradient of the parameters to be too large, causing trouble for algorithm training. Here, zero averaging of the sample data can speed up the convergence of the weight parameters of each layer in the network in back propagation.

2) MISSING VALUE PROCESSING
The existence of missing values increases the uncertainty of the data and affects certain parts of the data. In the process of data mining operations, the number containing null values may even make the algorithm messy, resulting in unreliable output. Among the data obtained from the database, there are cases where some samples did not collect data at certain points in time. In view of this phenomenon, there are two cases to deal with. If the sample has few missing values, we use the average of the previous and subsequent data of the missing data to fill in the data value; if the sample has many missing values, considering that the sample may lose more useful information, the sample is deleted.

3) BALANCE DATA
Increasing training samples is conducive to fitting the real decision function. However, it is unrealistic to increase the training samples unlimitedly. At the same time, for the collection of physiological characteristic data, there are always a large number of normal samples, while the number of diseased samples will be relatively few, that is to say, the imbalance of data is widespread. The most common metric used to evaluate machine learning techniques is accuracy. When the data is unbalanced, this measurement method does not work properly (the difference between patients with disease and patients without disease is quite large). Through transformation, new samples are obtained from the original sample data, which is a method often used in neural networks to increase the number of samples. In fact, as long as it has no effect on the final medical inquiry judgment of the sample, various transformation methods are allowed. Regarding the physiological feature data, considering that left-right flipping may affect its temporal characteristics, since this paper plans to use a 1 * X convolution kernel, the order of the physiological feature data is no longer important because it will not affect the result of the convolution, so the order of the eight rows of data can be disrupted, thereby increasing the number of training samples.

B. RESULT ANALYSIS
After a lot of attempts, this article finally regards the input data as a two-dimensional image. The dimension of the input layer is 8 * 60; the convolutional layer 1 (CONV1) has a total of 16 feature maps. Each feature map uses a 1 * 7 convolution kernel, and this layer outputs 16 8 * 60 feature maps. Pooling layer 1 uses 1 * 2 sampling kernels, and outputs 8 * 30 feature maps; convolutional layer 2 has a total of 32 feature maps, and uses 1 * 7 convolution kernels to generate 8 * 30 size feature map. The output of pooling layer 2 uses a sampling core with a size of 1 * 2, and an output feature map with a size of 8 * 15. Convolutional layer 3 has a total of 64 feature maps, and a 1 * 2 convolution kernel is used to generate 64 8 * 15 feature maps. Pooling layer 3 uses a sampling core of 1 * 3 size, and outputs a feature map of 8 * 5 size. After the fully connected layer, the classified output is performed.
To evaluate the model, two main methods are used: holdout validation and 5-fold cross validation.
For the remainder method, the data set is divided into training set, test set and validation set according to the ratio of 5:3:2. The training set is used by the neural network for the training process, the test set is used to estimate the prediction error rate after neural network learning, and the setting of the validation set can avoid CNN overfitting. Taking all training samples as the input of CNN, the accuracy curve of the CNN optimization algorithm under the test set and validation set is shown in Figure 8. It can be seen from the change curve of the correct rate of the training set and the verification set that the accuracy of both is above 80%, and the network has no problems of over-fitting and under-fitting.
Taking into account the impact of the existence of dead pixels in the training data on the performance of the algorithm model, a part of the training data is randomly cleared, and the processed data is used as the test set to train the model. The  result is shown in Figure 9. Among them, the proportion of bad pixel data in the training data indicates that the data corresponding to the value is randomly cleared. 5% means that 5% of the training data is randomly selected and cleared to zero, and these data are regarded as dead pixel data. Judging from the accuracy rate shown in the figure, when the dead pixel data occupies 5% of all training data, the accuracy rate of the CNN optimization algorithm is still 88.2%. This is still a relatively good value, indicating that the CNN optimization algorithm is better. The initialization of model weights is very important for network training. Bad initialization parameters can cause gradient propagation problems and reduce training speed; good initialization parameters can accelerate convergence and are more likely to find a better solution. Here we compare the influence of the four parameter initialization methods on the accuracy of the model. It can be seen from the data in Figure 10 that when the parameter initialization mode selects adaptive initialization, the best accuracy is obtained.
We compare the impact of two different pooling methods on the accuracy of CNN, and the results are shown in Figure 11. Generally speaking, the maximum pooling can  reduce the deviation of the estimated mean value caused by the parameter error of the convolutional layer, and retain the texture information; while the average pooling is more to reduce the increase in the variance of the estimated value caused by the limited size of the neighborhood. Here, when the maximum pooling method is selected, the accuracy rate is higher than the average pooling performance.
We compare the effects of the activation functions Sigmoid, tanh, and ReLU of the three CNNs on the performance of the CNN. Among them, tanh is the deformation of Sigmoid, both are saturated activation functions. It can be seen from the results in Figure 12 that the accuracy rate of Sigmoid tanh ReLU, in which the accuracy rates of Sigmoid and tanh do not exceed 87%. When ReLU is used as the activation function, the average accuracy of the algorithm reaches about 88%, which is significantly higher than the accuracy of the other two saturated activation functions.
In the CNN reverse algorithm, the loss function is iteratively optimized by gradient descent to find the minimum value, and the batch gradient descent method is mostly used. This method divides the data into several batches according to the selected batch size, and calculates after traversing the data in a batch, and then calculates the gradient of each  parameter to update the gradient. Figure 13 compares the accuracy of the model CNN optimization algorithm under different batch sizes. It can be seen that when the batch is too small, the accuracy is not high due to too strong randomness and insufficient training depth. Within a reasonable range, the larger the batch, the higher the accuracy rate. However, after a certain range is exceeded, the number of iterations required to run a complete data set is reduced, resulting in slower correction of the parameters. The figure shows that when the batch size is 51, the model obtains the best accuracy.
We compare the difference between the proposed network structure CNN optimization algorithm and the other two network structures. One contains only 3 * 3 size convolution kernels (CNN[A]), and the other contains 3 * 3 and 5 * 5 size convolution kernels (CNN[B]). There is no doubt that the performance of the CNN optimization algorithm is the best, as shown in Figure 14.
The main idea of the five-fold cross-validation method is to randomly divide the data set into five partitions, each time one of the five partitions is used to test the model, and the other four partitions are used to train the model. Therefore, each sample in the data set is used once in testing and four times  in training. Generally speaking, the main advantage of fivefold cross-validation is that it has lower variance than a single support set evaluator. It reduces this difference by averaging five different partitions. Therefore, it is less sensitive to any partition bias on training or test data. On the same data set, the algorithm model CNN optimization algorithm proposed in this paper is compared with different medical consultation techniques used to predict disease outcomes. The results are shown in Figure 15.
It can be seen from the data in Figure 15 that the average accuracy of the KNN method is 89.5%, which is an undesirable result. This may be because KNN has a strong assumption of independence for each feature in the model, and does not take into account the correlation between features, and the physiological feature data used in the experiment does not meet the conditions of independence. The average accuracy of the CNN optimization algorithm model proposed in this paper has reached 91.8%, which is higher than the accuracy of any of the other two methods. Therefore, the CNN optimization algorithm structure proposed in this paper has achieved better results in the prediction of disease medical consultation after adapting and adjusting physiological data. The experimental simulation results reflect the performance superiority of the convolutional neural network in the prediction of disease medical consultation.

VI. CONCLUSION
Based on the research experience in the field of Internet of Things consultation and artificial intelligence medical services and the problems faced by the current Internet of Things consultation services, this article clarifies the multi-party cooperation relationship in the service process. According to the characteristics of the Internet of Things technology, we build an Internet of Things monitoring environment, clarify the use of Internet of Things technology equipment and data collection methods, design an E-R database model and define a database storage mode. This paper proposes a training algorithm based on the difficulty of medical inquiry to improve the performance of medical inquiry of convolutional neural network. The improved learning algorithm emphasizes the need to pay more attention to the dangerous samples in each category in the training process of the network, and the adjustment of the parameters in the network should also be affected by these samples. By adding the penalty for the error of the dangerous samples in the loss function, the convolutional neural network is strengthened to learn the dangerous samples with low medical inquiry confidence. At the same time, the proposed new loss function can be regarded as a generalization of the original loss function from its form, which is more universal. The signal characteristics applicable to the convolutional neural network are analyzed, and an algorithm data set is created based on the matching samples in the MIMIC II database. According to the characteristics of the sample data, the structure of the convolutional neural network was adjusted to obtain a suitable model, and the model parameters were changed to discuss the influence of the pooling method, parameter initialization method, and activation function on the accuracy rate, and the final algorithm model was obtained. The recognition performance of the algorithm model in this paper is compared with the classic model, and the method is compared with machine learning methods on the same data set. The simulation results show that the algorithm model in this paper is better than the other two classic models, and it also shows the best performance in comparison with other machine learning methods.