Consumer ProductsDecision MakersDefenseEditorialsIndustrial Additive ManufacturingTrends 2026

Detecting 3D printed Ghost Guns using AI

Exploring how AI can identify untraceable 3D printed gun components and address a growing safety challenge

Stay up to date with everything that is happening in the wonderful world of AM via our LinkedIn community.

Ghost Guns — guns that aren’t traceable and potentially pose a safety risk to the public if intended for harm — have been increasingly prominent in the news. From the assassination of Japanese ex-Prime Minister Shinzo Abe in 2022 to the more recent assassination of UnitedHealthCare CEO Brian Thompson, both incidents involved ghost guns with the latter reportedly involving a 3D-printed pistol and suppressor.

Ghost guns have surged in popularity due to their accessibility and anonymity. Unlike traditional firearms, which require background checks and serial numbers, ghost guns can be assembled at home using kits or 3D-printed components, bypassing existing firearm regulations. The proliferation of online resources for 3D models of gun parts has made this issue more pressing as anyone with a 3D printer and minimal technical knowledge can create untraceable weapons. Law enforcement agencies and policymakers are increasingly challenged by this emerging threat.

In this article, I will discuss a technical approach to addressing the issue of 3D-printed ghost gun parts, raise a question about practical implementation, and invite interested parties to build on this work.

Technical background

3D data are complex and computationally expensive to work with using traditional algorithms — something anyone who has used CAD software before understands. For this reason, a machine learning approach using a transformer-based encoder is employed to extract significant features from 3D models. This allows for accurate classification of gun parts, regardless of changes to the 3D model’s geometry, rotation, or translation intended to evade detection.

Transformer-based encoders excel in processing 3D data due to their ability to learn spatial relationships between points in 3D space. Unlike 2D image classification, which relies on pixels, 3D models require analysis of point clouds, meshes, or voxel data, which are inherently more complex. The model’s robustness to adversarial changes, such as rotations and translations, is achieved by leveraging data augmentation during training, ensuring it generalizes well across diverse input configurations. Furthermore, the model’s ability to classify noisy or partially obscured data makes it a reliable tool in real-world scenarios where perfect 3D models are rare.

Exploring how AI can identify untraceable 3D printed ghost guns and their components and address a growing safety challenge
Basic model architecture for classification of gun components (image by author)

The machine learning model used has been trained on a dataset of over 10 million 3D models, providing an encoder capable of reliably extracting meaningful features. This pretrained model is then fine-tuned on a dataset of individual gun components for the task of classifying a 3D model as either “Gun Component” or “NOT a Gun Component,” with a 0–100% confidence value.

Results

For the purpose of this article, 10,000 random 3D models were used as test data, 400 of which contained gun components, including top slides, barrels, bottom frames, and magazines. The first item I tested is the top slide of a handgun:

Exploring how AI can identify untraceable 3D printed ghost guns and their components and address a growing safety challenge
Top Slide Classification Result (image by author)

The top slide was positively identified with a high confidence value of approximately 98.4%. I tested multiple top slides from various generations and models of handguns, some of which included modifications for functional and cosmetic purposes. Next, I tested the lower frame of a handgun:

Bottom Frame Classification Result (image by author)

The bottom frame of a gun is the regulated component — meaning if someone were to 3D print this part and purchase the other parts (e.g., the top slide, barrel, and magazine) at a store or online, they would effectively possess a functional firearm without it being traceable. Finally, I examined one of the random 10,000 models that was not a gun component:

Random Model Classification Result (image by author)

This particular example was not difficult for the ML model to classify correctly. Next, I analyzed the results across all 10,000 examples included in this article:

Exploring how AI can identify untraceable 3D printed ghost gun components and address a growing safety challenge
Output logits for 10,000 examples (image by author)

As shown in the plot above, the values produced by the ML model for gun components are linearly separable from those of non-gun components. During preliminary training on a smaller subset of the dataset, I achieved an accuracy of 96.4% in classifying gun components correctly. All misclassifications were from components such as magazines or barrels — not the lower frame of the gun. In isolation, when detecting the lower frame, the model was 100% accurate.

Adversarial cases, such as toy guns or 3D models that resemble gun parts but are non-functional, represent a unique challenge. While the model is highly effective at distinguishing functional gun components, it may struggle to differentiate between deceptive inputs, like a Nerf gun frame or a non-functional prop gun.

Plausibility

Detecting gun components with AI is one thing, but practical feasibility and implementation are another. Implementing an AI system like this poses a primary challenge: distribution. That is, how do we integrate this system into the 3D printing pipeline in a safe and effective manner? I will leave this question open while focusing on the technical aspects of practical application.

This ML model can run both in the cloud, accessible via an API, and on edge devices such as the Raspberry Pi 4B. The Raspberry Pi has become increasingly popular among 3D printer OEMs due to the industry-wide transition to firmware systems like Klipper and RepRap. However, at the time of writing, the model cannot yet run on the smaller processors commonly found in 3D printer mainboards. With modifications to the architecture, fine-tuning, pruning, and quantization, the model could eventually run on almost any 3D printer’s mainboard.

Integrating this system into the 3D printing pipeline raises questions about ethical responsibility. One approach could involve embedding the model directly into firmware updates for popular 3D printers, ensuring that gun components are flagged before printing. However, this raises privacy concerns among 3D printing enthusiasts who value open-source principles and autonomy over their devices. Collaborative efforts between industry leaders, regulators, and the maker community will be critical to striking a balance between public safety and user freedom. Additionally, safeguards must be put in place to prevent misuse of this technology, such as falsely flagging benign objects or targeting specific user groups.

Conclusion

If you enjoyed this article and find this topic as fascinating as I do, I invite you to reach out and share your thoughts, ideas, or feedback. Whether you’re a researcher, an industry professional, or someone passionate about the intersection of technology and safety, your perspective could help shape the future of this work.

Related Articles

4 Comments

  1. Its amusing that this author thinks that 3D printed gun parts, which provide freedom from government control for those looking to defend themselves, is a threat but thinks, AI, the most dangerous and utterly foolish thing humans have ever conceived of, is some sort of solution. I strongly suspect that any company trying to Sabotage its own printers with this sort of “update” won’t be waiting long to find that a disgruntled user has introduced and distributed a creative “update” of his own to said companies servers and products, locking down the former and completely bricking the latter. The latter in particular is absurdly easy to do. Finally, the simple fact is, when it comes to proven, truly dangerous people, the government has a foolproof way to keep them from obtaining firearms: Lock them up and keep them locked up upon first conviction of violent crime. Of course the government won’t do this because the purpose of gun control is really just to CONTROL people who obey laws and has nothing to do with control of actual proven violent offenders, whom, the government obviously has very little concern over if it is releasing them back into society where they can commit more violence with a plethora of tools having nothing to do with a gun.

  2. Hello Peter Lebiedzinski,

    I found your article very interesting. Is there any way to gain access to the code and dataset you used?

    Best regards.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Newsletter

Join our 12,000+ Professional community and get weekly AM industry insights straight to your inbox. Our editor-curated newsletter equips executives, engineers, and end-users with crucial updates, helping you stay ahead.