davinp
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # The Joy of Testing Todays blog post is going to be a little bit different, we are going to be documenting the testing we have done during the devolopment of this project. The post will be a little bit dry compared to the others and we recommened that you consider skipping it, unless you are really interested in the different results from our various attempts at getting our system working. As we've outlined before, an ANPR system follow some usual steps. We have broken our testing down into the following headings based on these steps; - Plate Extraction - Character Segmentation - Character Recognition - Full System ***** ## Plate Extraction ### Plate Extraction without using NN Our first attempt at plate extraction was based on Connected Component labeling, and we go into it in more depth in the blog post [here.](https://frosty-goldberg-5fed5e.netlify.com/posts/plate-extraction/). | | Test 1 | Test 2 | | -------- | -------- | -------- | | Images Tested | 10 | 50 | | Results | 80% | 25% | #### Comments: For Test 1 we considered it a success if a correct bounding box for a license plate was found, regardless if other bounding boxes where found which where incorrect. For Test 2 we considered it a success if the only bounding boxes found where around a license plate. The first test performed much better as the test images we had where almost entirely of Irish License plates, and where taken from mostly shallow angles. For the second test we used more varied images, which were more representive of images which will actually be used by our system. #### Conclusion: From these tests we found that this method of plate extraction would not work for our uses, however we did make great use of this program to build a dataset of images for use later in our project. ### Plate Extraction with NN | | Test 1 | Test 2 | Test 3 | | -------- | -------- | -------- | ------ | | Images Tested | 50 | 50 | 300 | | Results | 50% | 85% | 95% | | Model Used | 1 | 2 | 2 | | Minimun % Probability | 50% | 35% | 33% #### Sample Result Image ![Sample Result Image](https://i.imgur.com/5lS0FhQ.jpg) #### Comments: Test 1 used our first model generated, this was created after about 16 hours of training on a CPU. We tested at this point, while the loss was still fairly high, in order to check the progress of the training. This was done as we were still quite new to NN training and were sure when to stop training to avoid overfitting. Test 2 and 3 used our second model taken from training which seemed to perform the best of all the models we had generated. The minimun percentage probabilty is the lowest confidence level that the system will still consider correct. We found that 33% gave the best results, while minimizing false positives. #### Conclusion: After the second and the third test we were quite happy with the results, and felt that we could proceed to the next stage of our project, marking plate extraction as complete. ***** ## Character Segmentation ### Character Segmentation without using NN | | Test 1 | Test 2 | | -------- | -------- | -------- | | Images Tested | 10 | 100 | | Results | 90% | 25% | #### Comments: Our first attempt at character segmentation was similar to our first plate extraction attempt, using connected component labeling. See [this](https://frosty-goldberg-5fed5e.netlify.com/posts/character-segmentation/) blog post for more information on it. Our first test performed well as the test images were all "ideal" images for this system. They were clear photos taken directly in front of the license plate. The second test we considered a success if the it clearly segmented at least 75% of the characters in a given license plate. #### Conclusion: The results of these tests were expected, and turned out very similar, although slightly better, than the tests on our original plate extraction program. Overall it performed quite well on images taken from a shallow angle, but fell down when the angle was steeper and failed completely when there was overlap between character. From the above results we knew that this program would work for our system. We still used this program to generate some images for training and testing our character recognition program, so we were glad we spent the time developing it. ### Character Segmentation using NN | | Test 1 | | -------- | -------- | | Images Tested | 300 | | Results | 50% | | Model Used | 1 | #### Sample Result Image ![Sample Segment Result](https://i.imgur.com/I0Eh5l1.jpg) #### Comments: The minimun percentage probability was left at 35% for all of the above tests. This results differed from previous tests as the success rate didn't seem to be effected by the angle the images were taken from. This was one of the benefits of using neural nets trained on a variety of images. Unlike the previous character segmentation test, we only considered these a success if they corrected segmented 85% of the characters, as this did not struggle with steep angles or overlapping characters. #### Conclusion: Overall the results for this program were quite good, and we felt that with increasing the size of the dataset and more training would return an excellent increase in results. We eventually decided to not go ahead with this however as the output of this program was to be fed to the k-NN OCR, which we had to decided to not devolop further at this point. ***** ## Character Recognition ### Character Recognition using k-NN | | Test 1 | Test 2 | Test 3 | | -------- | -------- | -------- | ------ | | Images Tested | 50 | 50 | 100 | | Results | 40% | 70% | 50% | | Model Used | 1 | 2 | 3 | #### Comments: For model 1 and 2, these only work with numbers, and not with letters, as such they were test only on numbers. The test images they were tested on were not representive of our expected data as they were mostly clear and from a shallow angle. The third model and test were on all characters, both numbers and letters, and the test data better represented the type of images we planned to work with. #### Conclusion: Overall the k-NN OCR worked well, but struggled with images which were taken from an angle or were of poor quality. This was supported by other systems we found online which were only shown working with ideal images. This OCR did work very well with clear images though, so while it may not work for our system it would be quite useful for others, such as digitizing scanned documents. ### Character Recognition using NN | | Test 1 | Test 2 | | -------- | -------- | -------- | | Images Tested | 10 | 100 | | Results | 10% | 17% | | Model Used | 1 | 2 | |Minimum % Probability | 50% | 95% | #### Sample Result Images ![Sample Recognition result](https://i.imgur.com/Lc2aoec.jpg) ![Sample Recognition result](https://i.imgur.com/L8I2qLm.jpg) #### Comments: Model 2 had been trained for longer than model 1, on the same images. This was done to bring the loss down to an acceptable level. It was difficult to assess whether a particular image had it characters successfully recognized. This was because our NN was recognizing a huge number characters, and multiple successful recognitions for each characters. This continued even after setting the minimum percentage probability to 95%. Despite all this, it was still recognizing many of the characters successfully. #### Conclusion: From these results it was clear to us that the net simply didn't have even data to train on. For more information on this please see [this](https://frosty-goldberg-5fed5e.netlify.com/posts/creating-an-ocr-engine-part-2/) blog post. It was clear the amount of data we would need to generate was out of the scope of our project, so we looked at using alternatives. ### Character Recognition using Google Vision | | Test 1 | | -------- | -------- | | Images Tested | 300 | | Results | 97% | #### Comments: We set up google vision and used the same test images that we used on our previous OCR tests. One issue encountered was that the google vision OCR would pick up some very small characters on license plates and their surrounds, however we didn't could this as a failure if it still correctly picked up the rest of the plate. #### Conclusion: We were very happy with these results, and decided to move forward with using google vision as our OCR engine. We would have liked to do more tests but we were limited with how much we could use google vision before we would incur charges. ***** ## Complete System ### Complete System on Pythonanywhere | | Test 1 | Test 2 | | -------- | -------- | ------ | | Images Tested | 50 | 50 | | Average RunTime|17 Seconds|10 seconds| #### Comments: This test was timed from when the upload button was clicked, until the the result was displayed on the webpage. All tests were done on the site while it was live, rather than locally. Test 2 was performed after optimizations were made. #### Conclusion: Even after the optimizations were made, we were still far off our target time of <5 seconds. Locally we had it performing much faster with the use of multi-threading, which is not supported with Pythonanywhere, so we decided to lost at other hosting options. ### Complete System on Ngrok | | Test 1 | | -------- | -------- | | Images Tested | 50 | | Average RunTime| 3 Seconds| #### Comments: This test was also time from when the upload button was clicked, until the result was displayed. This was done while the site was live, and from a different machine, on a different LAN, than the one hosting the website. #### Conclusion: Using Ngrok to host on our own machines allowed us to implement our optimizations using multi-threading. This resulted in much better performance and we were far under our 5 second goal. We decided that we were happy with these results, and would use Ngrok as our hosting solution.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully