# Consumption Risk and Legal Response in B2C e-Commerce Based on Neural Network Algorithm

Authors: Sisi Chen
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

In the era of “Internet +,” the world economy is increasingly globalized and informatized, the development of China’s B2C e-commerce is facing unprecedented opportunities, but it is also constrained by consumption risks. Consumption risk will make consumers have a crisis of trust in e-commerce, which brings uncertainty to the development of B2C. Therefore, it is very necessary to predict and prevent consumption risks in B2C e-commerce and take corresponding legal countermeasures. It is well known that neural networks (NNs) have strong predictive ability, but there are also problems such as lack of stability. As a result, in order to improve the prediction ability of neural network, principal component analysis and particle swarm technology are proposed in this paper as well as its stability and prediction error. The risk prediction accuracy of the BP NN (BPNN) technique was the lowest at 60% and the maximum at 70%, according to the experimental results of this research. The GA-BP technique has the lowest risk prediction accuracy of 80 percent. The risk prediction accuracy of the PSO-BP method is the lowest with 90% and the highest with 100%. Although the NN before the improvement can effectively predict the consumption risk, the risk prediction ability of the improved NN combined with principal component analysis and particle swarm algorithm is higher. Therefore, in life, the relevant personnel can apply the GA-BP and PSO-BP methods to the consumption risk prediction in B2C e-commerce to reduce the risk and make the e-commerce develop better.


---

## Body

## 1. Introduction

In recent years, cases arising from the consumption risk of B2C e-commerce have occurred frequently, and e-commerce behavior has been accompanied by unavoidable risk factors since its birth, and the risk of e-commerce is even more objective. Consumption risks include computer network risks, information security, and property security. Compared with the traditional business, e-commerce is special in that its formation and development are inseparable from computers, the Internet, big data, and related verification systems. And this unique operating mode often forms a natural shelter for people with ulterior motives, so that their illegal behavior can be covered up. At the same time, there is nothing that can be done by the party with rights and interests. This will mainly involve consumers’ rights to fair trade and privacy. What’s more serious is that if it is used improperly, the safety of consumers’ goods and funds will also have a considerable degree of risk.In real life, buyers cannot make judgments from the network whether the seller’s credibility is up to standard and whether the products sold are qualified. It can be seen from this that the mismatch and asymmetry of information held by consumers and sellers will inevitably ignite the crisis of trust in e-commerce under the temptation of interests brought by e-commerce behaviors. Based on this, under the carrier of new technology, it is a topic with practical value and practical significance to fully understand the consumption risks of e-commerce, predict and think about relevant legal countermeasures, give full play to law’s distinctive value, and then ensure the continued growth of B2C e-commerce. The innovation of this paper is that it not only describes the prediction ability of the NN algorithm, but also further optimizes the NN to make its risk prediction ability more powerful, thereby reducing the consumption risk in B2C e-commerce.China’s e-commerce is booming, and the country is aggressively promoting the establishment of an e-commerce legal framework. According to Zhang, as mobile network technology advances, mobile e-commerce becomes more mature, but it also presents opportunities and difficulties to businesses. One of the issues in e-commerce is the danger of consumption. He made pertinent proposals for resolving the consumption risk [1]. E-commerce, Fan et al. argued, might promote intercity trade and reduce spatial consumption inequality as a new trade technology. The emergence of e-commerce has increased China’s total trade volume. But the rights and interests of consumers were also threatened [2]. Wang et al. linked consumers’ choice motivations and their attitudes toward consumption with four e-commerce models. In B2C, consumers occupy a dominant position, so the protection of consumers’ rights and interests was also the most important [3]. Hu believes that e-commerce started to develop because of the promotion of the Internet. But in Internet-enabled e-commerce, challenges also arise, and that is the issue of security and privacy. He proposed that the B2C model can effectively guarantee consumer payment and privacy protection [4]. Zhang et al. believes that e-commerce has become a new trend in economic development. Especially in the promotion of “big data” it has been widely used. And with the continuous changes in technology and consumption patterns, it has also been welcomed by more and more people [5]. Scientists agree that B2C e-commerce is accelerating, and many welcome it. However, consumer risk is a major challenge for e-commerce. This will hinder the development of e-commerce without an effective solution.NN has a high predictive ability, which can be applied to the prediction of e-commerce consumption risk. Lee et al. found that the application of NNs to reduce the risk of e-commerce consumption has gained momentum. He developed a framework to construct a prediction method for e-commerce consumption risk and provide decision support for e-commerce enterprises [6]. He et al. studied the robust state estimation problem of NNs. The parameter uncertainty could be solved by the particle swarm algorithm, so he applied the particle swarm algorithm to the NN and achieved good results [7]. Jiang et al. found that most e-commerce companies ignore consumption risks. By applying principal component analysis in the learning process of the NN, he found that the proposed principal component analysis NN is more suitable for the prediction of consumption risk [8]. Mei et al. found that multi-layer NN is one of the most powerful methods in machine learning, but the stability of NN is not high. Therefore, he integrated the NN into the particle swarm algorithm, thereby improving the consumption risk prediction ability of e-commerce [9]. All scholars believe that NN has better risk prediction ability and can predict the consumption risk of e-commerce. But the NN also has certain defects, so scholars began to try to optimize the NN to make it more predictive. However, scholars do not describe the specific optimization method, nor do they have specific experiments.To sum up, the scholars found that the consumption risks in e-commerce would hinder the development of e-commerce; they also put forward the use of NN to predict the consumption risks in e-commerce and the lack of legal measures, and optimized the NN to achieve better prediction effect. However, there is a lack of specific optimization process and experimental data. Therefore, in view of these shortcomings, this paper not only proposes corresponding legal countermeasures, but also specifically describes the optimization method of NN. The NN algorithm incorporates principal component analysis and the particle swarm technique, and experimental comparisons are conducted. The results demonstrate that, while a single NN algorithm can forecast more than 60% of the time, the accuracy of the method proposed in this paper may exceed 80%. It also shows that the improved method developed in this paper is more suitable for the prediction of e-commerce consumption risk.


## 2. B2C e-Commerce Consumption Risk Prediction

### 2.1. Consumption Risk Prediction Based on BPNN

B2C e-commerce has gradually become popular in people’s life. However, there are other risk variables, including qualitative and quantitative risk [10]. B2C refers to a model of e-commerce and a retail model of direct-to-consumer sales of products and services. E-general commerce’s development has not yet matured, and it is still in its early stages. As a result, risk prediction is critical in order to limit the danger of overconsumption. This promotes the healthy and long-term development of e-commerce. Widespread support for e-commerce breaks down time and space barriers, changes the nature of trade, significantly accelerates the flow of goods throughout society, helps reduce business costs, and improves business competitiveness.People have a better grasp of the structure and function of neurons as science and technology improve, and neurons as a complex microscopic biological information processor are becoming more and more enlightening to people in the information era [11]. Figure 1 shows the BPNN’s structure diagram.Figure 1
Structure diagram of three-layer BPNN.As shown in Figure1, the BP network is a specialized management learning network that propagates the error value from the output layer to the input layer, modifying the initial assignment and threshold. BP network can not only approximate any correlation function, but also has strong nonlinear mapping ability. Not only that, but also parameters such as the number of network interfaces, the number of processing units per layer, and the learning coefficient can be set under certain conditions. It reenters the forward expansion and continuously reduces the error by training loops over multiple samples until the desired accuracy is achieved [12].The number of nodes in the output layer should be determined according to the expected output form of the research challenge. In the absence of risk, low risk, medium risk, and high risk, this contribution should take the form of a prediction [13]. The purpose of the hidden layer is to abstract the input data properties into another dimensional space to reveal its more abstract properties that can be better linearly distributed. Before creating a BP, it is necessary to correctly determine the number of neurons in the hidden layer. Calculate the number of neurons in the hidden BP layer using the following equation:(1)nh=n+m+a,where nh is the number of neural nodes in the hidden layer, and the threshold excitation function is the simplest excitation function, also known as the M-P function. There are only two kinds of output states, namely, excitation and inhibition. Threshold activation functions are used for neurons and primitive perceptrons. This is non-differentiable. Its function expression is(2)fa=1,a≻0,0,a≤0.Piecewise linear functions are more complex than the threshold functions. Within a certain input signal strength range, the output signal will no longer change [14]. Its function expression is(3)fa=ka,0≺x≺a,kx,x≻a.A BP neural network essentially performs an output–input mapping function. Mathematical theory shows that 3D neural networks can approximate any nonlinear function with any precision. BPNN has the ability to implement any comprehensive nonlinear mapping, but BPNN also has certain necessary constraints, especially in the following areas: Firstly, the network needs more parameters, and there is no effective method for the selection of parameters. This leads to the lack of stability of the BP algorithm [15]. Secondly, it is easy to get caught up in the local optimum. A local minimum may arise in practical situations, and the global optimum must be determined by resetting the initial parameter values. In response to these issues, several specialists and academics have offered certain approaches for improving or optimizing the BPNN’s performance. To improve the NN, this paper uses principal component analysis and the particle swarm approach, as discussed in the next section.


### 2.2. Consumption Risk Prediction Based on GA-BPNN

In order to transform a set of correlated variables into a set of linearly uncorrelated variables, the method of orthogonal transformation can be used, and the transformed set of variables is called principal components. Analysis of the main components is a relatively complex statistical method, which requires several variables to be taken into account. However, this statistical method can effectively reduce the amount of data, simplify the data, and facilitate the use of other data for calculations [16]. BPNN must use certain functions to perform operations during calculation, and the frequently used operations are: optimization method, momentum method, fast algorithm, and so on. These algorithms are not very different, and the slight difference between them is reflected in the learning efficiency. The principal component analysis can effectively improve the learning efficiency.For the sample data, multiple units should be counted, which is represented by n. At the same time, multiple indicators should be set up, which is represented byP. The statistical scheme is:(4)A=A11A12LA1pA21A22LA2pMMMMAn1An2LAnp=A1,A2,L,Ap,where A1 is called the first principal component, A2 is called the second principal component, and so on. The first thing to do is to reduce the difference between the indicator data, which includes the difference in quantity, and the second thing to do is to standardize the processing matrix. The matrix R is calculated:(5)rij=∑k=1naki−alakj−al∑k=1naki−al2∑k=1nakj−al2.In the formula,aki is the correlation coefficient between the original variable and the formula, and the cumulative contribution rate P is calculated by the formula, as in(6)P=λi∑k=1pλk.The error must be controlled within a reasonable range. Firstly, the signal must be transmitted in the output layer. The error signal will be back-propagated and data corrected, and a reasonable error threshold will be determined at the same time [17, 18]. The error threshold can analyze the cause of the error to eliminate or reduce the error. The threshold value needs to be continuously revised, because it is always changing, so to correct it, the weight correction principle can be used, shown in(7)∂E∂θt=∂E∂θt∂St∂θt.Principal component analysis can further improve the NN algorithm so that it can adapt to the learning rate of the subject, and it can effectively improve the learning effect and make it more accurate from the target [19]. Therefore, most of the research in this paper adopts this method for function training.


### 2.3. Consumption Risk Prediction Based on PSO-BPNN

Particle Row Optimisation (PSO) is a random search algorithm and can simulate the behaviour of birds in the search for food. It can be solved as follows: use a fully trained network to predict and simulate the risk of e-commerce consumption [20]. The numerical values of the input data fluctuate widely since the survey sample data is at the input end of the approach, and the data must be preprocessed before network training. Data preprocessing can remove invalid data, irregular data, and wrong data. The most often used data normalization approach is one that turns all data into numbers between [0, 1] in order to eliminate the size differences between data orders. The approach is the most often used data normalization method, as shown in(8)ai=ai−aminamax−amin.The mean squared error is a measure of the degree of difference between the estimator and the estimated. The weights and thresholds of the BP network correspond to the particles in a particle swarm, as(9)fitness=E=1N∑i=1Nbreal−bi2.And the fitness value of the new particle is calculated as(10)Vidk+1=wVidk+c1r1Pidk−Aidk+c2r2Pgdk−Aidk.After updating the position and speed of the particle, the fitness value of the new particle can be calculated. As an improvement in the classic BP method, the fitness value of the new particle is calculated using the central quadratic error function used to calculate the neuron network error. Fitness refers to the relative ability of individuals with known genotypes to transfer their genes to the gene pool of their offspring under specific environmental conditions. Because if the traditional BP method is enhanced, the obtained value can solve the problem, and the upgraded BPNN method is trained to construct an e-commerce consumption risk prediction method.


### 2.4. Legal Countermeasures for Consumption Risk in e-Commerce

Due to the rapid development of e-commerce, there are a lot of problems to be solved almost every day. There are many new problems that the traditional laws cannot involve, and traditional departmental laws cannot be placed anywhere. This brings difficulties to the trial of the case and the division of responsibilities. Therefore, adhering to the problem orientation, mainly aiming at how to solve the consumption risks of the current B2C e-commerce development, and proposing corresponding legal responses, are still necessary in the current era.


#### 2.4.1. Using Scientific Methods to Establish a Unified Credit Evaluation System

In e-commerce behavior, when the buyer evaluates the seller’s credit on the online trading platform, he will unconsciously review his own feelings caused by the seller’s behavior in the whole process. Therefore, the buyer’s experience will directly affect the credit evaluation. However, the current standards that can be used in the current evaluation are too simple to set, which cannot satisfy the rich expressions of buyers, and cannot effectively guide them to make accurate evaluations. Therefore, it is necessary to optimize the index structure in the evaluation system and improve the depth and coverage of the index content. The corresponding levels of the various indicators are updated with more specific quantitative figures and more detailed textual descriptions to clarify their differences. This helps to reduce the ambiguity caused by subjective evaluation, and further exerts the value of the credit evaluation system.


#### 2.4.2. Strengthening the Management of Online Identity Authentication

In real life, any online shopping platform should be based on the authentication of consumers and sellers. Implementing high-standard identity authentication supervision on both the sides of B2C e-commerce behaviors online not only positively maintains the order of e-commerce behaviors. It can also play a good role in regulating both parties involved in e-commerce behaviors, and promote both parties to establish correct credit awareness and moral inclinations at the beginning of consumption behavior. It is suggested to introduce authoritative official institutions to carry out identity authentication for both parties, so that through the intervention of a third party, the value of authentication can be truly achieved, and the interests of both parties can be fundamentally protected.


#### 2.4.3. Improving the Construction of the Information Security Legal System

Compared with the various security risks faced by traditional offline business exchanges, the phenomena of denial transactions, information risks, and data theft in e-commerce transactions are also the only way to go in the development process. It is believed that in the process of establishing and improving various information security legal systems, all aspects of the e-commerce transaction process will inevitably continue to improve and develop accordingly. The corresponding level of information security will be steadily improved, and the risks generated by e-commerce transactions will be far less than the benefits of all aspects.


## 2.1. Consumption Risk Prediction Based on BPNN

B2C e-commerce has gradually become popular in people’s life. However, there are other risk variables, including qualitative and quantitative risk [10]. B2C refers to a model of e-commerce and a retail model of direct-to-consumer sales of products and services. E-general commerce’s development has not yet matured, and it is still in its early stages. As a result, risk prediction is critical in order to limit the danger of overconsumption. This promotes the healthy and long-term development of e-commerce. Widespread support for e-commerce breaks down time and space barriers, changes the nature of trade, significantly accelerates the flow of goods throughout society, helps reduce business costs, and improves business competitiveness.People have a better grasp of the structure and function of neurons as science and technology improve, and neurons as a complex microscopic biological information processor are becoming more and more enlightening to people in the information era [11]. Figure 1 shows the BPNN’s structure diagram.Figure 1
Structure diagram of three-layer BPNN.As shown in Figure1, the BP network is a specialized management learning network that propagates the error value from the output layer to the input layer, modifying the initial assignment and threshold. BP network can not only approximate any correlation function, but also has strong nonlinear mapping ability. Not only that, but also parameters such as the number of network interfaces, the number of processing units per layer, and the learning coefficient can be set under certain conditions. It reenters the forward expansion and continuously reduces the error by training loops over multiple samples until the desired accuracy is achieved [12].The number of nodes in the output layer should be determined according to the expected output form of the research challenge. In the absence of risk, low risk, medium risk, and high risk, this contribution should take the form of a prediction [13]. The purpose of the hidden layer is to abstract the input data properties into another dimensional space to reveal its more abstract properties that can be better linearly distributed. Before creating a BP, it is necessary to correctly determine the number of neurons in the hidden layer. Calculate the number of neurons in the hidden BP layer using the following equation:(1)nh=n+m+a,where nh is the number of neural nodes in the hidden layer, and the threshold excitation function is the simplest excitation function, also known as the M-P function. There are only two kinds of output states, namely, excitation and inhibition. Threshold activation functions are used for neurons and primitive perceptrons. This is non-differentiable. Its function expression is(2)fa=1,a≻0,0,a≤0.Piecewise linear functions are more complex than the threshold functions. Within a certain input signal strength range, the output signal will no longer change [14]. Its function expression is(3)fa=ka,0≺x≺a,kx,x≻a.A BP neural network essentially performs an output–input mapping function. Mathematical theory shows that 3D neural networks can approximate any nonlinear function with any precision. BPNN has the ability to implement any comprehensive nonlinear mapping, but BPNN also has certain necessary constraints, especially in the following areas: Firstly, the network needs more parameters, and there is no effective method for the selection of parameters. This leads to the lack of stability of the BP algorithm [15]. Secondly, it is easy to get caught up in the local optimum. A local minimum may arise in practical situations, and the global optimum must be determined by resetting the initial parameter values. In response to these issues, several specialists and academics have offered certain approaches for improving or optimizing the BPNN’s performance. To improve the NN, this paper uses principal component analysis and the particle swarm approach, as discussed in the next section.


## 2.2. Consumption Risk Prediction Based on GA-BPNN

In order to transform a set of correlated variables into a set of linearly uncorrelated variables, the method of orthogonal transformation can be used, and the transformed set of variables is called principal components. Analysis of the main components is a relatively complex statistical method, which requires several variables to be taken into account. However, this statistical method can effectively reduce the amount of data, simplify the data, and facilitate the use of other data for calculations [16]. BPNN must use certain functions to perform operations during calculation, and the frequently used operations are: optimization method, momentum method, fast algorithm, and so on. These algorithms are not very different, and the slight difference between them is reflected in the learning efficiency. The principal component analysis can effectively improve the learning efficiency.For the sample data, multiple units should be counted, which is represented by n. At the same time, multiple indicators should be set up, which is represented byP. The statistical scheme is:(4)A=A11A12LA1pA21A22LA2pMMMMAn1An2LAnp=A1,A2,L,Ap,where A1 is called the first principal component, A2 is called the second principal component, and so on. The first thing to do is to reduce the difference between the indicator data, which includes the difference in quantity, and the second thing to do is to standardize the processing matrix. The matrix R is calculated:(5)rij=∑k=1naki−alakj−al∑k=1naki−al2∑k=1nakj−al2.In the formula,aki is the correlation coefficient between the original variable and the formula, and the cumulative contribution rate P is calculated by the formula, as in(6)P=λi∑k=1pλk.The error must be controlled within a reasonable range. Firstly, the signal must be transmitted in the output layer. The error signal will be back-propagated and data corrected, and a reasonable error threshold will be determined at the same time [17, 18]. The error threshold can analyze the cause of the error to eliminate or reduce the error. The threshold value needs to be continuously revised, because it is always changing, so to correct it, the weight correction principle can be used, shown in(7)∂E∂θt=∂E∂θt∂St∂θt.Principal component analysis can further improve the NN algorithm so that it can adapt to the learning rate of the subject, and it can effectively improve the learning effect and make it more accurate from the target [19]. Therefore, most of the research in this paper adopts this method for function training.


## 2.3. Consumption Risk Prediction Based on PSO-BPNN

Particle Row Optimisation (PSO) is a random search algorithm and can simulate the behaviour of birds in the search for food. It can be solved as follows: use a fully trained network to predict and simulate the risk of e-commerce consumption [20]. The numerical values of the input data fluctuate widely since the survey sample data is at the input end of the approach, and the data must be preprocessed before network training. Data preprocessing can remove invalid data, irregular data, and wrong data. The most often used data normalization approach is one that turns all data into numbers between [0, 1] in order to eliminate the size differences between data orders. The approach is the most often used data normalization method, as shown in(8)ai=ai−aminamax−amin.The mean squared error is a measure of the degree of difference between the estimator and the estimated. The weights and thresholds of the BP network correspond to the particles in a particle swarm, as(9)fitness=E=1N∑i=1Nbreal−bi2.And the fitness value of the new particle is calculated as(10)Vidk+1=wVidk+c1r1Pidk−Aidk+c2r2Pgdk−Aidk.After updating the position and speed of the particle, the fitness value of the new particle can be calculated. As an improvement in the classic BP method, the fitness value of the new particle is calculated using the central quadratic error function used to calculate the neuron network error. Fitness refers to the relative ability of individuals with known genotypes to transfer their genes to the gene pool of their offspring under specific environmental conditions. Because if the traditional BP method is enhanced, the obtained value can solve the problem, and the upgraded BPNN method is trained to construct an e-commerce consumption risk prediction method.


## 2.4. Legal Countermeasures for Consumption Risk in e-Commerce

Due to the rapid development of e-commerce, there are a lot of problems to be solved almost every day. There are many new problems that the traditional laws cannot involve, and traditional departmental laws cannot be placed anywhere. This brings difficulties to the trial of the case and the division of responsibilities. Therefore, adhering to the problem orientation, mainly aiming at how to solve the consumption risks of the current B2C e-commerce development, and proposing corresponding legal responses, are still necessary in the current era.


### 2.4.1. Using Scientific Methods to Establish a Unified Credit Evaluation System

In e-commerce behavior, when the buyer evaluates the seller’s credit on the online trading platform, he will unconsciously review his own feelings caused by the seller’s behavior in the whole process. Therefore, the buyer’s experience will directly affect the credit evaluation. However, the current standards that can be used in the current evaluation are too simple to set, which cannot satisfy the rich expressions of buyers, and cannot effectively guide them to make accurate evaluations. Therefore, it is necessary to optimize the index structure in the evaluation system and improve the depth and coverage of the index content. The corresponding levels of the various indicators are updated with more specific quantitative figures and more detailed textual descriptions to clarify their differences. This helps to reduce the ambiguity caused by subjective evaluation, and further exerts the value of the credit evaluation system.


### 2.4.2. Strengthening the Management of Online Identity Authentication

In real life, any online shopping platform should be based on the authentication of consumers and sellers. Implementing high-standard identity authentication supervision on both the sides of B2C e-commerce behaviors online not only positively maintains the order of e-commerce behaviors. It can also play a good role in regulating both parties involved in e-commerce behaviors, and promote both parties to establish correct credit awareness and moral inclinations at the beginning of consumption behavior. It is suggested to introduce authoritative official institutions to carry out identity authentication for both parties, so that through the intervention of a third party, the value of authentication can be truly achieved, and the interests of both parties can be fundamentally protected.


### 2.4.3. Improving the Construction of the Information Security Legal System

Compared with the various security risks faced by traditional offline business exchanges, the phenomena of denial transactions, information risks, and data theft in e-commerce transactions are also the only way to go in the development process. It is believed that in the process of establishing and improving various information security legal systems, all aspects of the e-commerce transaction process will inevitably continue to improve and develop accordingly. The corresponding level of information security will be steadily improved, and the risks generated by e-commerce transactions will be far less than the benefits of all aspects.


## 2.4.1. Using Scientific Methods to Establish a Unified Credit Evaluation System

In e-commerce behavior, when the buyer evaluates the seller’s credit on the online trading platform, he will unconsciously review his own feelings caused by the seller’s behavior in the whole process. Therefore, the buyer’s experience will directly affect the credit evaluation. However, the current standards that can be used in the current evaluation are too simple to set, which cannot satisfy the rich expressions of buyers, and cannot effectively guide them to make accurate evaluations. Therefore, it is necessary to optimize the index structure in the evaluation system and improve the depth and coverage of the index content. The corresponding levels of the various indicators are updated with more specific quantitative figures and more detailed textual descriptions to clarify their differences. This helps to reduce the ambiguity caused by subjective evaluation, and further exerts the value of the credit evaluation system.


## 2.4.2. Strengthening the Management of Online Identity Authentication

In real life, any online shopping platform should be based on the authentication of consumers and sellers. Implementing high-standard identity authentication supervision on both the sides of B2C e-commerce behaviors online not only positively maintains the order of e-commerce behaviors. It can also play a good role in regulating both parties involved in e-commerce behaviors, and promote both parties to establish correct credit awareness and moral inclinations at the beginning of consumption behavior. It is suggested to introduce authoritative official institutions to carry out identity authentication for both parties, so that through the intervention of a third party, the value of authentication can be truly achieved, and the interests of both parties can be fundamentally protected.


## 2.4.3. Improving the Construction of the Information Security Legal System

Compared with the various security risks faced by traditional offline business exchanges, the phenomena of denial transactions, information risks, and data theft in e-commerce transactions are also the only way to go in the development process. It is believed that in the process of establishing and improving various information security legal systems, all aspects of the e-commerce transaction process will inevitably continue to improve and develop accordingly. The corresponding level of information security will be steadily improved, and the risks generated by e-commerce transactions will be far less than the benefits of all aspects.


## 3. Experiments Based on Improved BPNN

In order to verify the effectiveness of the approach, this study simulates the enhanced BP neural network based on the analysis of the key components and the WHO algorithm. The middle hidden layer has a large number of neurons. There is currently no effective selection procedure. The optimal number of nodes in the hidden layer can only be determined empirically and tested using experimental techniques, as illustrated in Table1.Table 1
Initial parameter settings.
Number of hidden layer nodesLearning efficiency (%)Error accuracyMaximum number of training sessionsConvergence efficiency (%)2530.062100474550.060100556580.061100598570.0571006410620.05510079According to Table1, when there are 10 neurons in the hidden layer, the network converges and the efficiency of convergence is high. For this reason, this paper chooses the following initial settings when there are 10 nodes: 100 times is the maximum number of trainings allowed, the learning efficiency of the network is 62%, and the error accuracy is 0.055. Selecting this set of parameters is conducive to the smooth progress of the experiment.This paper selects an e-commerce enterprise (Enterprise A) to determine the consumption risk from 2015 to 2020. The results are shown in Table2.Table 2
Consumption risk determination results of enterprise A from 2015 to 2020.
YearsNo riskMild riskMedium riskSevere risk2015127532016182025620171197220185500201915252115202021261210As shown in Table2, the score range of no police is 0–25 points, the score range of light police is 25–50 points, the score range of medium police is 50–75 points, and the score range of serious police is 75–100 points. No risk scores range from 0 to 25 points, mild risk scores range from 25 to 50 points. The consumption risk judgment results of Enterprise A from 2015 to 2020 are light warning, medium risk, light risk, no risk, heavy risk, and medium risk. The purpose of this paper to determine its risk in recent years is to use three risk prediction methods to determine the consumption risk of Enterprise A in previous years. Therefore, the better method among the three forecasting methods is compared, and it can be applied to the consumption risk forecast in the coming year to better cope with and reduce risks.


### 3.1. Enterprise A’s Consumption Risk Prediction Results

The training data for the BPNN technique in this research are the six consumption risk indicators of Enterprise A from 2015 to 2020. Statistical methods are utilized to establish the consumption risk warning level of sample Enterprise A from 2015 to 2020 in the previous section. It is employed as the target output value of the output layer of the BPNN in this article, and the data from 2015 to 2020 is used as the BPNN method’s training sample. To begin, the MATLAB simulation training is conducted out with the indicator data of Enterprise A from 2015 to 2020, using the BPNN. The data in the sample is used as the input node, and the corresponding annual risk level is used as the expected output value. The training results are shown in Figure2.Figure 2
Risk prediction ability of BPNN.Figure2 shows that, while the BPNN’s risk prediction ability is not awful, there is still some mistake. In order to confirm that the GA-BPNN and PSO-BPNN presented in this paper have greater advantages in consumption risk prediction than the BPNN, the experiment takes the data of these two methods from 2015 to 2020 as test samples, and then compares the actual output results with the expected output values from 2015 to 2020. The specific test results are shown in Figure 3.Figure 3
The specific detection results of the two methods. (a) GA-BPNN detection results. (b) PSO-BPNN detection results.
(a)(b)As shown in Figure3, the actual output from 2015 to 2020 is basically the same as the expected output, and the correct rate reaches 100%. It can be seen that the simulation effect of the GA-BPNN and PSO-BPNN constructed in this paper is very satisfactory, and can be used for consumption risk prediction in the future years. In the detection of the following prediction methods, the detection accuracy of the GA-BPNN and the PSO-BPNN is projected to be perfect. The output of the two approaches is generally the same as the predicted output, and the error is minor, according to the comparison. It demonstrates the efficacy of the strategy presented in this paper. The trained and tested GA-BPNN and PSO-BPNN can be used for consumption risk prediction by studying individual modules in depth.


### 3.2. Comparison Results of Nonlinear Fitting Ability

In terms of determining the goal value, this study uses the principal component approach to analyze the sample data and determine the predicted output value of the GA-BPNN and PSO-BPNN training samples. This solves the data acquisition challenge. However, its representativeness to the consumption risk level needs to be further verified. The overall error of the three methods in the training process, that is, the change curve of the mean square error is shown in Figure4.Figure 4
Overall error and nonlinear fitting ability of the three methods. (a) The overall error of the three methods. (b) The nonlinear fitting ability of the three methods.
(a)(b)As seen in Figure4, when the iteration is increased to 100 times, the test sample’s error sum is lowered to 0.02. The overall error of the PSO-BPNN technique stabilized at roughly 2% after 120 cycles of training, indicating convergence. This effectively overcomes the shortcomings of the traditional BPNN.In overall, this research presents a rather comprehensive understanding of e-commerce consumption risk prediction, with good prediction accuracy. The following two aspects can be used to improve the procedure in the future: firstly, the data of multiple enterprises is used for NN training. In order to improve the accuracy and reliability of the prediction method, the number of training samples and detection samples can be increased; secondly, for the setting of the target output value, the opinions of e-commerce experts can be referred to improve the credibility of the expected output value of the prediction method.


### 3.3. Comparison Results of the Prediction Accuracy of the Three Methods

An empirical investigation will be conducted utilizing the test sample data after the PSO-BP network has been trained. Figure5 shows the prediction results of the three methods.Figure 5
Prediction results of three methods.Figure5 depicts the prediction results of the three methods: BP has some advantages in the prediction of consumption risk. However, there are still issues. For example, it is prone to falling into local optima, respectively. The revised BP approach improves the accuracy of consumption risk prediction greatly.The comparison of the accuracy of the prediction results of the three methods is shown in Tables3–5.Table 3
BP method risk prediction results.
QuantityErrorsCorrect rate (%)False positive rate (%)1046040206703030970304012703050166832Table 4
Risk prediction results of the GA-BP method.
QuantityErrorsCorrect rate (%)False positive rate (%)10190102038515306802040782.517.55078614Table 5
Risk prediction results of the PSO-BP method.
QuantityErrorsCorrect rate (%)False positive rate (%)100100020195530293.36.740392.57.55059010Tables3–5 illustrate the following: When the sample size is 10, the number of false positives is 4, and the false positive rate is 40% in the BP method’s risk prediction. The number of false positives is 16 when the sample size is 50, and the false positive rate is 32%. When the number of samples is 10, the number of false positives is 3, and the false positive rate is 30% in the GA-BP method’s risk prediction. The number of false positives is 13 when the sample size is 50, and the false positive rate is 26%. When the sample size is ten, the PSO-BP approach predicts the risk. It can be seen that, no matter how many or few samples are tested, the BP method has the highest misjudgment rate of risk prediction, and the PSO-BP method has the lowest misjudgment rate. Therefore, in the consumption risk prediction of e-commerce, PSO-BP method can be used to predict in order to better prevent risks and reduce costs.GA-BP and PSO-BP prediction methods have better prediction ability of consumption risk. In practice, a certain reference can be provided by the improved BP approach based on principal component analysis and the PSO algorithm. Depending on the method’s specific risk evaluation value, businesses and investors can pay different levels of attention to them.


## 3.1. Enterprise A’s Consumption Risk Prediction Results

The training data for the BPNN technique in this research are the six consumption risk indicators of Enterprise A from 2015 to 2020. Statistical methods are utilized to establish the consumption risk warning level of sample Enterprise A from 2015 to 2020 in the previous section. It is employed as the target output value of the output layer of the BPNN in this article, and the data from 2015 to 2020 is used as the BPNN method’s training sample. To begin, the MATLAB simulation training is conducted out with the indicator data of Enterprise A from 2015 to 2020, using the BPNN. The data in the sample is used as the input node, and the corresponding annual risk level is used as the expected output value. The training results are shown in Figure2.Figure 2
Risk prediction ability of BPNN.Figure2 shows that, while the BPNN’s risk prediction ability is not awful, there is still some mistake. In order to confirm that the GA-BPNN and PSO-BPNN presented in this paper have greater advantages in consumption risk prediction than the BPNN, the experiment takes the data of these two methods from 2015 to 2020 as test samples, and then compares the actual output results with the expected output values from 2015 to 2020. The specific test results are shown in Figure 3.Figure 3
The specific detection results of the two methods. (a) GA-BPNN detection results. (b) PSO-BPNN detection results.
(a)(b)As shown in Figure3, the actual output from 2015 to 2020 is basically the same as the expected output, and the correct rate reaches 100%. It can be seen that the simulation effect of the GA-BPNN and PSO-BPNN constructed in this paper is very satisfactory, and can be used for consumption risk prediction in the future years. In the detection of the following prediction methods, the detection accuracy of the GA-BPNN and the PSO-BPNN is projected to be perfect. The output of the two approaches is generally the same as the predicted output, and the error is minor, according to the comparison. It demonstrates the efficacy of the strategy presented in this paper. The trained and tested GA-BPNN and PSO-BPNN can be used for consumption risk prediction by studying individual modules in depth.


## 3.2. Comparison Results of Nonlinear Fitting Ability

In terms of determining the goal value, this study uses the principal component approach to analyze the sample data and determine the predicted output value of the GA-BPNN and PSO-BPNN training samples. This solves the data acquisition challenge. However, its representativeness to the consumption risk level needs to be further verified. The overall error of the three methods in the training process, that is, the change curve of the mean square error is shown in Figure4.Figure 4
Overall error and nonlinear fitting ability of the three methods. (a) The overall error of the three methods. (b) The nonlinear fitting ability of the three methods.
(a)(b)As seen in Figure4, when the iteration is increased to 100 times, the test sample’s error sum is lowered to 0.02. The overall error of the PSO-BPNN technique stabilized at roughly 2% after 120 cycles of training, indicating convergence. This effectively overcomes the shortcomings of the traditional BPNN.In overall, this research presents a rather comprehensive understanding of e-commerce consumption risk prediction, with good prediction accuracy. The following two aspects can be used to improve the procedure in the future: firstly, the data of multiple enterprises is used for NN training. In order to improve the accuracy and reliability of the prediction method, the number of training samples and detection samples can be increased; secondly, for the setting of the target output value, the opinions of e-commerce experts can be referred to improve the credibility of the expected output value of the prediction method.


## 3.3. Comparison Results of the Prediction Accuracy of the Three Methods

An empirical investigation will be conducted utilizing the test sample data after the PSO-BP network has been trained. Figure5 shows the prediction results of the three methods.Figure 5
Prediction results of three methods.Figure5 depicts the prediction results of the three methods: BP has some advantages in the prediction of consumption risk. However, there are still issues. For example, it is prone to falling into local optima, respectively. The revised BP approach improves the accuracy of consumption risk prediction greatly.The comparison of the accuracy of the prediction results of the three methods is shown in Tables3–5.Table 3
BP method risk prediction results.
QuantityErrorsCorrect rate (%)False positive rate (%)1046040206703030970304012703050166832Table 4
Risk prediction results of the GA-BP method.
QuantityErrorsCorrect rate (%)False positive rate (%)10190102038515306802040782.517.55078614Table 5
Risk prediction results of the PSO-BP method.
QuantityErrorsCorrect rate (%)False positive rate (%)100100020195530293.36.740392.57.55059010Tables3–5 illustrate the following: When the sample size is 10, the number of false positives is 4, and the false positive rate is 40% in the BP method’s risk prediction. The number of false positives is 16 when the sample size is 50, and the false positive rate is 32%. When the number of samples is 10, the number of false positives is 3, and the false positive rate is 30% in the GA-BP method’s risk prediction. The number of false positives is 13 when the sample size is 50, and the false positive rate is 26%. When the sample size is ten, the PSO-BP approach predicts the risk. It can be seen that, no matter how many or few samples are tested, the BP method has the highest misjudgment rate of risk prediction, and the PSO-BP method has the lowest misjudgment rate. Therefore, in the consumption risk prediction of e-commerce, PSO-BP method can be used to predict in order to better prevent risks and reduce costs.GA-BP and PSO-BP prediction methods have better prediction ability of consumption risk. In practice, a certain reference can be provided by the improved BP approach based on principal component analysis and the PSO algorithm. Depending on the method’s specific risk evaluation value, businesses and investors can pay different levels of attention to them.


## 4. Conclusion

Major nations can improve their economic competitiveness and gain an advantage in the distribution of global resources by using e-commerce. While e-commerce is still expanding without any major issues, those issues are preventing further growth. Consumption risk is the most prevalent concern, and it is a critical one that needs to be handled in the growth of e-commerce. Effectively addressing this issue will benefit not only the rights and interests of consumers, but also the long-term and healthy development of e-commerce. This study’s objective is to determine the methods to forecast consumption risk and provide legal solutions. To increase the ability of consumption risk prediction, the three methods were detailed in depth in the method. The three methods were evaluated in the experimental section to ensure that the upgraded NN was more useful to risk prediction. In the experiment, the consumption risk prediction of Enterprise A was firstly analyzed. The prediction method of GA-BP is more predictive and can be used in real life. Then, the prediction accuracy and adaptability of these three methods are compared, and it is found that the GA-BP and PSO-BP prediction methods are also better than the traditional neural network algorithm in terms of prediction accuracy and adaptability. Therefore, the improved NN algorithm in this paper could be beneficial to risk prediction. Finally, this paper also proposed corresponding legal countermeasures, hoping to bring a ray of life to the problem of e-commerce consumption risks.



---

*Source: 1073894-2022-09-01.xml*