Neural Net Reads The Gas Meter

In an ideal world, the role of technology would be to make all of our lives easier. And although all the ads suddenly appearing in our smart TVs and gaming systems might make it seem otherwise, some technology can still improve our lives if we work hard at it. For [Cian], that meant training a neural network to read his gas meter so he wouldn’t have to do it himself.

The root issue here is twofold, first that [Cian]’s gas company hasn’t upgraded their own technology to modern, remote-readable meters, and second that the meter can’t be read by a gas employee because it’s hidden in the depths of [Cian]’s basement. This latter fact requires him to delve into Moria-like depths to get to the meter, so the solution here was to place a Raspberry Pi in this location instead. With a camera pointed at the meter, it’s not quite capable of discerning digits on its own so a neural network was trained in order to get accurate readings of the dial. And, finally, since the machine is networked already [Cian] set it up to automatically notify the gas company of its reading so he is now completely out of the loop.

For automating tedious tasks like these, the Raspberry Pi with something like OpenCV as a computer vision tool is a fairly mature platform for light machine learning duties like these. We’ve seen license plate readers as well as neighborhood traffic surveys built on these platforms to help automate human labor away, making our lives easier one single-board computer at a time.

25 thoughts on “Neural Net Reads The Gas Meter

  1. Wouldn’t it be eeasier and more accurate to sample the pixel color in certain places and calculate the correct digit? It’s a segmented display after all so it can only be (shades of) “black” or “white”

  2. AI is overkill for this, unless you’re doing it as a learning experience. OpenCV can do this just as well. Since the segment positions and sizes don’t change you can just strip it to black and white, and average colors for regions.

    1. He’s using OpenCV, walks you through the whole process of training from a dataset captured for his specific task and provides images for you to duplicate his setup if you want. The least you could do is read his write up.

      1. I mean that there is no training or AI required. All you have to do is define regions within the image that match the segment positions, get The average color and that tells you whether the segment is on or off

        1. So implement that, and let us know how well it works in real world conditions.

          I don’t know about you, but I’ve done things like this, and wish I had better tools at the time. Simplistic rulesets tend to not work in the real world under real world conditions where you don’t have full control of everything.

          1. I have in the past for a radio receiver, reading a backlit LCD for the current frequency. It worked fine for the same reason it would here; that you do have control of everything. The display is fixed in position and distance, you can set up the lighting however you wish, and you can put an enclosure around it to keep out stray light.

          2. I found this project particularly interesting. I’m considering doing the same thing to read pressure from my water system, as well as usage/cycle information on my water softener and other equipment. I really appreciate this write-up.

  3. Does a neural network count as AI ? It might be where the current generation started but where’s the unjustified memory usage and hallucinations ?
    Also, it apparently works reliably. I think it’s only machine-taught fuzzy logic.

    1. Yeah I ran that, it didn’t cope well with my analogue meter despite matching the training set well and very slow moving numbers. Took a good while to set up the digit areas etc but they still kept getting false readings when they were not “whole”. I gave up in the end and just used the camera to take my readings manually in the end. I think the comment above about just sampling pixels in specific locations and decoding them that way makes far more sense for a digital display, the neural net is overkill, but it’s a fun project to try.

      1. the neural net is overkill, but it’s a fun project to try

        I mentioned it in some other comments on the Youtube video, but that’s what I was aiming for. To learn more about neural networks and how they work. There’s more than a dozen ways to skin this cat at the end of the day – but it was a learning experience which I wanted to get out of it

        1. I enjoyed reading your writeup. Thank you, this is a project I have been considering for a long time. I am interested in doing something similar for a water pressure meter with an analog rotary dial indicator. Any thoughts?

  4. I worked with a company that did wireless MCUs. One of the applications of such MCUs was a design that had a small camera and the appropriate mounting to be put on top of an industrial meter (like an analog dial.) Every so often the MCU would wake up, light up the dial, take a picture, do some neural net processing and send the measurement back to the system.

  5. Adjust the focal range close enough that the display fills most of the image drop the resolution right down, maybe give it an led to keep illumination fairly consistent. As long as the camera stays fairly still, you only really need to read one pixel in the middle of each segment and give it a threshold value to assess light or dark. No doubt far more trustworthy than the statistical nature of a neural network.

  6. Designers gonna design, but why a neural net when OCR would almost certainly be 100% accurate. Seems to me to either be a case of every problem being a nail to a neural nets hammer

    1. It’s not 2016, neural networks are exceedingly common in OCR software since then. Estimates range from 75-90% of OCR software is using neural nets.

      Increases in OCR reliability are closely tied to neural nets and applying language rules to handle the remaining errors. Language rules aren’t going to work with a string of digits to correct any errors.

      Somebody even hints around here about AI and people are acting like technology stopped at 1975.

      1. I think you misunderstand the comment, but I’m glad you got your daily stretches in anyway. It’s important to stay limber, mentally.

        OCR using neural nets doesn’t answer the question. My comment is about training a bot to read numbers when a FOSS solution like Tesseract already exists. Given the “critical” nature of these readings, I think I’d rather build on something than start from scratch.

        I could understand if he’s using a small ESP32 that runs on the harvested heat of the meter itself, and requires a light set up; which might require the special digits only neural net. But they aren’t and they are using a raspberry pi. And given that Cian is using the Pi, it doesnt seem like they were really trying to challenge themselves.

        So again, the question is why train a neural net to do this unless the training is challenge.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.