Jump to content
Brian Enos's Forums... Maku mozo!

Machine vision to sort by headstamp


Recommended Posts

So far so good with the servos.  I'm testing the 2 different types and having no issues, if one will outlast the other remains to be seen.  It took a while before the dc motor board burned out.

I have 2 more design tweaks to make to the cad file.  Nothing major, but i think i'll be ready to share the designs from there.

So here's the magic question.  Is anyone interested in helping beta testing this?  You need a 3d printer, minor carpentry skils, a few hundred dollars disposable income, and some linux skills: know how to use ssh, scp, navigate around a bash shell, that sort of stuff.  The Image classification still isn't working to my satisfaction, and now that I changed cameras/lenses I'm retaking all of the images to see if that helps.  If I can get someone else to help by imaging and tagging a bucket of their brass it'll be a big help.

 

My main focus is still on 9mm.  Once i get a Model that's pretty accurate I plan on switching gears to .223

Link to comment
Share on other sites

  • Replies 236
  • Created
  • Last Reply

Top Posters In This Topic

@assnolaxSend me a PM and we'll discuss tomorrow.  I'm using an Nvidia Jetson now, along with an arducam and a low power microscope lens.  You could make it work with a pi hq cam, you'll just have to tweak the image capture code, shouldn't be too bad.

 

I'm using the adafruit servo hat so that works too.

 

I just ran a small sample set and I think i just got image classification up to an honest 85% accuracy.  I only tested on 40 images, but it's looking promising.

Link to comment
Share on other sites

@FingerBlaster
I Have Printers and someone who can help a bit with code and stuff, So I think I might be able to put this thing together and get it working. From there of yourse I can take images and send you everything you need. But be aware that we might use other brands of ammo here in Switzerland. If you let me know what to get hardware wise, I get paid on Tuesday so timing is near perfect :D

 

Link to comment
Share on other sites

I'm done accepting people to beta test for now.

 

Everyone who messaged me or posted here will get access to the files once I'm ready to share, i'm hoping by next weekend.  I tried to run some .223 through it since i know a lot of you are more interested in rifle brass, and it wasn't as good as i hoped with the last design revision.  Have to make yet another tweak.

 

@Hansimania send me a PM so I can keep track of you once i'm ready.

 

My main focus with the little time i had this weekend has been the Image classification, and a bug i was dealing with.  I'm making progress, and now i feel like if i get a lot more training data things should continue to improve and get more accurate.

 

The current stats are at the bottom of the post in code block text.


Probability threshold means how confident the computer is in the classification being a match to one of the available classes.  If it sees a peice of brass that's brand new.  Say it sees some starline brass and it's never seen that before, it's still going to try to categorize it to the known classes.  Right now my logic send matches over a certain threshold to their buckets if that headstamp has a bucket assigned.  If no bucket is assigned it still goes to the mixed brass bucket.  Anything under that threshold will go to the mixed bucket no matter what.

 

Example: Let's look at the below block that says 95%.  So what this means is assume i set the probably threshold to 95%, what do my results mean?

 

  • Correct above 95%: that means 363 pieces of brass, or 75% of the total brass was above the Threshold 95%, and went to the the right output.  IE 'FC' Brass went to the 'FC' bucket, but if it was Tula brass and i had no bucket assigned for Tula brass, it still goes to the mixed bucket.
  • Correct below X: that means  68 pieces or 14% of the total was below the Threshold %, even though the computer guessed right, the probability was too low so it went to the mixed bucket no matter what.  IE the computer guess that FC brass was in fact FC, but wasn't "super confident", so to be cautious it sent it to the mixed brass bucket.
  • InCorrect above X: That means 5 pieces or 1% of the brass went to the wrong bucket.  The computer was "really sure", but it was wrong.   It was "really sure" that a piece of Winchester brass was FC Brass and thus sent it to the FC brass bucket.  It made a mistake.
  • InCorrect below X: 43 peices or 8% of the total: the guess was wrong and the probability was low so it went to the mixed bucket.  So the computer guessed that Winchester was FC, but it wasn't sure, so it went to the mixed brass bucket.  Or maybe it saw a piece of brass it hasn't been trained on, like Starline, and it was only 50% sure so it sent it to the mixed bucket.

One of the incorrect peices of brass was in fact a "new" headstamp, it was PMP, and it was around 96% sure that it was PMC.  and sent it to the PMC bucket.

 

So in this 95%  example you could say it sorted 76.8% of the brass ran through it with a 1.35% error rate.  Out of 479 pieces of brass, 363 + 5 = 368 pieces were above the Threshold value.  368/479 = 76.8%.  5 out of 368 were wrong,  5/368 = 1.35%.

 

You will be able to set the threshold to whatever you want.  For example if i set it to 99%, 95%, 90% or 80% here's what i would look like.  As i get more training data my hope is that the results will improve.

 

99%
Total 479
Correct above 99%: 319 Percent 66 %
Correct below 99%: 112 Percent 23 %
InCorrect above 99%: 1 Percent 0 %
InCorrect below 99%: 47 Percent 9 %

 

 

95%
Total 479
Correct above 95%: 363 Percent 75 %
Correct below 95%: 68 Percent 14 %
InCorrect above 95%: 5 Percent 1 %
InCorrect below 95%: 43 Percent 8 %

 

 

90%
Total 479
Correct above 90%: 383 Percent 79 %
Correct below 90%: 48 Percent 10 %
InCorrect above 90%: 11 Percent 2 %
InCorrect below 90%: 37 Percent 7 %

 

80%
Total 479
Correct above 80%: 402 Percent 83 %
Correct below 80%: 29 Percent 6 %
InCorrect above 80%: 18 Percent 3 %
InCorrect below 80%: 30 Percent 6 %

 

Edited by FingerBlaster
Link to comment
Share on other sites

  • 3 weeks later...

@FingerBlaster. Bless me father for its a few week since we heard from you last!! I'm off the boat Irish Catholic so I can say that! Any update on testing, seems you fell off the radar. Hope all is well. Cheers 

Link to comment
Share on other sites

  • 2 weeks later...

hi Hansimania,

the guys that are doing this are in what I think is the least interesting part of such projects.

going from one built example to seeing if another one can be made...

most of the ideas are ...done.  just any challenges that come from building.

 

updates that the 3D printing is done or  testing servo travel limits

is not entertaining to write or post...

give 'em a poke in a couple of weeks, then they may have recovered from the wall

they are climbing...

 

miranda

 

Link to comment
Share on other sites

  • 1 month later...

I say this with all seriousness - I am so thankful there are folks like this group in the world….Most of the language in this thread makes no sense to me but I know it does to all of you….Folks like all of you participating in this thread discussion makes our lives better, simpler, and easier…..

 

I utilize A+ Brass to sort my 9mm brass and what a HUGE time saver Todd provides by having this type technology….. Again - Kudos to all of you that enjoy these type challenges and opportunities….I appreciate you more than you know…Mark

Link to comment
Share on other sites

  • 4 weeks later...

Just started hand sorting about 7000 .223 Cases of range brass. There are 6 diffrent headstamps. I had to think about this immediately and realy hope that we will hear from fingerblaster again. Or one of the guys that got the Files to help developing this might share some info? This thing realy needs to come to life :D

Best regards from Switzerland! 

Link to comment
Share on other sites

  • 2 months later...

Guys, if someone is still reading. 

It seems like my brother finds this a fun project. He already invested several evenings and many hours. The design for the bullet feeder and sorting assembly is basically done. It will be a modular design, allowing for diffrent diameters and lengths. The Program is already able to feed cases and take pictures automatically, and save them on a computer. Even some classification test was done with only a few thousand pictures he managed to take manually. I will let him know to share his wisdom here so all the followers of this thread never have to hand sort brass in quantities again!
The design is a bit diffrent from Fingerblasters. He designed some clamps instead of using wire to hold cases in place. Diffrent sizes of clamps can hold diffrent diameters and lengths. And for the sorter he came up with a design to sort into 3 ways, using one servo instead of 2 small motors. Instead of using a Nvidia jetson, everything will basically run from a computer, so no additional cost for that. I think his Servos and some V-Slot rails I had laying around are the biggest costfactors so far. Looks verry promising to me.

Link to comment
Share on other sites

On 11/26/2021 at 2:11 PM, Hansimania said:

Guys, if someone is still reading.

 

I just saw this thread last night and have read all six pages.  I would like to build one of these and I know a little programming, have raspberry pi's, and tools in my garage.  I'd be happy to contribute to building the beta version.

 

In reading the thread, getting the image classification going, can be done anywhere by a programmer once we have test images.

 

Let me know how I can help and/or participate.

 

 

Link to comment
Share on other sites

  • 2 months later...

Just to let you know, we are still on it. However, Stuff keeps breaking and problems keep occuring, but one way or another. we will get this thing working, and everybody who is interested can get the infos needed to make one I hope. I Made a video Today, just before my USB cam decided to die. This is still in picture taking or data collecting mode. But Working good. Trickiest part really seems to be the Image recognition. But I am confident Chris and Greg are going to find a way to make this work.

Best Regards

Hans

Link to comment
Share on other sites

  • 4 weeks later...

Is there still interest in this project? 

We are close, really close to getting it to work. We found flaws and made design updates to the printed parts. The only thing that still causes some issues is training the system so it gets to a level of precision that is equal to sorting by hand. For me thats somewhere close to 100%. It is a lot of work and Chris and Greg are investing hours and hours into getting the programming right. We will take more pictures and hopefully we can do a good testrun today. I'm super hyped  to finally see everything working together so good!

 

Best regards

Hans

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...