System approach to development of Intellectual Information Mobile System for Electric Power Metering

. The relevance of the work lies in the application of universal image processing for further verification of data. The use of pattern recognition makes it possible to quickly identify errors in the manual entry of various information. The object of the research is business processes aimed at detailed monitoring and metering of electric power of IDGC of Center and Volga Region, PJSC, Udmurtenergo branch. Subject of research - the principles of design and practical application of the intellectual system in the enterprise. The aim of the work is to increase the level of reliability of commercial accounting of electricity. Development of the Intellectual Information System for Electric Power Metering (IISEPM) by applying the data collection terminals has been proposed in order to solve the problem of mobile electricity metering. The implementation of IISEPM will reduce commercial losses and improve the observability and controllability of the power grid infrastructure. For enterprises, which activities are aimed at providing services for the electricity transmission to a large number of consumers, it is important to have an accurate idea of the number of the provided services. In the modern conditions, it is possible to automate the process of collecting information, so that in the future it will be possible to verify the received data in a single processing center. Taking readings from metering devices is a necessary monthly procedure. The traditional way is that the consumer writes down the meter readings on paper, and then also manually calculates the amount of energy spent per month. The next step for the consumer is to transfer the readings taken from the power sales company, where employees record the meter readings and then also manually calculates the amount of energy spent per month. The next step for the consumer is to transfer the readings taken from the power sales company, where employees record the meter readings in the database. The user has the right to transfer data remotely by logging into his personal account on the company's website. The power supply company, having received the consumer's data, calculates the cost of the electricity consumed at a certain tariff and notifies the consumer about it, sending him a receipt of payment. Automation will reduce the amount of paper media. The human factor will also be excluded, which will increase the accuracy of the calculated energy consumption and, therefore, the inadmissibility of emergency situations will be achieved.


Introduction
The accounting of fuel and energy resources is the basis of energy saving and is a necessary component of increasing energy efficiency. The first step to the creation of automated metering systems for fuel and energy resources is the installation of energy metering devices.
Induction and electronic meters are used to account for electricity, each of which has its advantages and disadvantages Induction meters are simple and cheap, have a low accuracy class (2.0) and poor protection against the theft of electricity. Usually induction meters are not used for an automated method of reading.
Electronic meters have a higher cost compared to induction meters, but they allow taking readings with a high accuracy class (up to 0.2). Such devices can store electricity metering data, provide the ability to remotely read the energy consumed, which allows the use of these meters in automated information and measuring systems for commercial metering of electricity [1].

Analysis of existing solutions
Simplification of work on the accounting of electricity has become possible with the use of various automated accounting systems. The task of the systems is to collect in a short time the energy sales company of all data on electricity flows, which are subsequently processed. Information is analyzed for the purpose of making forecasts for consumption. The result of the analysis is a report on the consumed and supplied electricity, and calculations for electrical energy must be carried out. The introduction of accounting systems will allow you to accurately determine the amount of energy consumed.
The technical solution of the tasks posed by a powerful automated system. It should be built using multifunction meters, an intermediate hub, reliable two-way interface communication and advanced software on the server of the power supply organization. Such systems can be built on a wired or wireless interface connection.
Automated informative electric power accounting system based on smart meters are protected from theft, and provide reliable metering of electricity. Metering devices are equipped with an alarm system that responds to outside intervention by recording a violation in the counter log [2].
The high cost of classical systems of automated metering of electricity prevents their introduction in large quantities. The branch of Udmurtenergo PJSC IDGC of Center and Volga Region develops and implements an electronic automated system Mobile Energy Accounting using data collection terminal [3]. The data collection terminal allows you to take readings from various types of meters. The cost of acquiring new meters is missing. The controller carries out the control using the terminal. At the first round, the controller assigns an individual number (barcode) to each metering device, sticking it onto the meter case. In case of detection of theft of electricity, an act is taken out without accounting consumption, using data from the database and mobile printer. The data entered into the database by the terminal are transmitted over the GPRS channel. During the next round, it is enough for the controller to read the data values of the barcode previously installed on the metering device verify all data with the Database and make changes. Fig. 1 shows the system processes occurring in IISEPM, participants in the processes and the relationship between them. Table 1 shows a comparative analysis of various methods of automated electricity metering using automated informative electric power accounting systems and mobile terminals.
Mobile accounting and control of electricity consumption using data collection terminals implies a significant reduction in paper workflow, eliminates the influence of the operator on entering data into the database, improves the process of determining the amount of transmitted energy to consumers, reduces the time of data acquisition. The collection and transmission of data is carried out in real time, which allows reducing the time of data receipt from the object to the operator. In this accounting solution, a center for monitoring and managing the process has been created, access to data on the site is monitored, and personnel productivity is assessed based on the operational data of the system.  One of the information objects transmitted when using the data collection terminal is a photo of the front panel of the metering device. When using photographs as a source of information, the question arises of extracting data directly on the image. To do this, you need to use processing methods, that is, pattern recognition.
Since most of the metering devices are located in the premises, there are situations in which the metering device is not sufficiently lit. Under such circumstances, the characters in the readings are not clearly visible, but at the same time it is enough to find the sum of the pixels in the machine processing. To eliminate these effects, you need to adjust the brightness and contrast of the image. Increasing or decreasing contrast relative to the average signal level is one of the simplest correction methods. This method does not work in most cases because it does not take into account the uneven illumination. You can use an adaptive algorithm for changing the contrast with respect to the local average value in order to take into account uneven lighting [4]. There are special algorithms, for example, such as computing using an integral matrix, for quickly calculating local averages [5].
After color correction, it is necessary to carry out the first analysis of the contents in the photo. For this purpose, there are various filtering methods. One of the simplest transformations is binarization by a threshold value [6]. Such an algorithm can automatically select objects that are on a uniform background. Attachment points of electricity metering devices are different, and they can be surrounded by additional equipment. Therefore, when using the binarization algorithm, objects can be misinterpreted, leading to erroneous conclusions.
The method of finding the edges is another filtering method in which the background on which the objects are located is not important [7]. This algorithm is associated with the detection of irregularities in the image, that is, differences in brightness, changes in color and orientation of the surface. The Kenny detector is one of the most accurate detection methods for boundaries [8]. This detector finds the borders in the image in several stages. The first stage consists of removing unnecessary details and noise in the image. Next, the gradient of the image is calculated and after that, all edges are transformed into thinner lines. At the last stage of processing, the edges are gathered into contours. The next step in image processing is finding the contours that directly characterize the position of the object, its direction and tilt. For this, there are algorithms for automatic search of contours, which can select objects on the image to collect a characteristic of their location. However, it is better to use faster image analysis methods.
The analysis of photographs taken in real conditions revealed a large number of images with distorted perspectives. The defect does not correctly classify the image, since the position of the special features of the metering devices is distorted relative to the axes. For image transformation, affine transformations and homography are used [9]. For such algorithms, the transformation matrix must be known. To find it, an image processed by a Kenny detector use, which is free from interferences and insignificant elements. The transformation matrix is a contour consisting of four lines, each of which is in the analysis of the entire image.
Hough Transformation use to find lines, circles, or other simple shapes [10]. The transformation represents the object to be found in the form of a parametric equation. The final stage of the transformation is the analysis of the resulting space and the combination of maximum values to create the equations of a given object. At the next stage of image processing, it is necessary to select the reading of the electricity-metering device. The system in question assumes processing of about 3000 photos per day. An important factor is the speed of image processing. To date, the most optimal method of fast processing without significant loss of quality of recognition is the Viola-Jones method [11,12,13].
When using the Viola-Jones method, a base with photographs is necessary for the learning algorithm. Therefore, its implementation is possible only with a large amount of accumulated information about the objects.
After finding the reading of the metering device, you can begin to recognize the value of this reading. There are ready-made libraries, such as Tesseract [14] that can recognize text with high accuracy. However, since the background, font, distances between characters can be different, the algorithms used in such libraries allow a large number of errors. Therefore, it is necessary to use an algorithm that will take into account the peculiarities of writing numbers on the scoreboard. For this, it is possible to implement the recognition method using convolutional neural networks.

The intellectual system structure
The problem of recognizing information in the diagram refers to the type of cognitive tasks peculiar to the human brain, and it is necessary to create a system of artificial intelligence to solve the task [2]. Such a system should be divided into the solution of three subtasks: formation and accumulation of knowledge; application of this knowledge to solve problems; accumulation of new knowledge, as far as solving the problems. To accomplish this, the following functions must be implemented: learning, presentation and reasoning.
At the first stage, the image is transmitted to the information-processing server. The process of information transfer requires a relatively large amount of energy and it is necessary to carry out this operation when the terminal is connected for charging. All images collected by the controller for the working day are sent to the information collection server.
To solve the problem of finding readings on photographs of electricity metering devices, it is necessary to develop a program for converting printed text images to machine. There are many ready-made libraries for OCR.
Tesseract is one of the most popular text recognition software. Initially, you need to enlarge the original image so that the height of the entire text is at least 20 pixels. A large contrast of characters is also necessary; otherwise, during the binarization of the image, the information will be lost. Fig. 2 shows the work of a program written using the tessnet library using tesseract technologies. In order for the printed text recognition algorithm to work, the called method needs to submit an image, a file with information about recognizable characters, and the text color. The algorithm, when passing through the image from left to right, determines the characteristics of the first characters and creates a layout, after which, the rest of the picture searches for characters with specific parameters. Therefore, initially, for higher accuracy of recognition of all information, it is necessary to select all blocks of text. The work of the library showed high efficiency of black text recognition on a white background. However, if the input part of the image with the indication, the recognition results are very inaccurate. This is because there is more distance between characters and cannot be interpreted as an integral value.
Analysis of the program showed that for the recognition of indications of electricity metering devices, it is necessary to use classical methods of pattern recognition in order to improve the quality of photography. To speed up the development of such algorithms, there are ready-made libraries. One of the most popular and easy-to-use means for image recognition is the OvenCV library. During the development of a software product that solves the problem, at the initial stage, a program was designed that recognizes the type, name and number of the meter, as well as the current indication of energy consumption by a photo of the energy meter. Pattern recognition was performed using the Viola-Jones method using the OpenCvSharp library [16].

Results of creating a recognition system
In the process of studying the theme of pattern recognition, more efficient methods and algorithms were identified. Fig. 3 shows the image with a distorted perspective. To eliminate this drawback, the method of affine transformations was chosen (Fig. 4).

Conclusion
During the development of a software product that solves the problem, at the initial stage, a program was designed that directly searches for each of the digits at a previously found instrument reading. Fig. 6 shows the recognition statistics for instruments with a mechanical scoreboard. The diagram shows that the algorithm makes a large number of errors at the stage of finding numbers.
To improve the recognition statistics, a solution was developed in which, at the first stage, the algorithm finds all the numbers on the reading, and then processes each number and makes a hypothesis of its membership. Fig. 7 shows the statistics, which shows that this approach provides a more accurate classification of readings.  Work performed under grant 090601 / VSV18 Kalashnikov Izhevsk State Technical University.