Science News & Breakthroughs Featured May 23, 2026

How Machine Learning Can Detect Coin Similarity

How coin images are located, represented and compared, from Hough circles and U-Net segmentation to learned embeddings, and why evaluation splits decide whether results hold up.

SC
ScienceTrace Science Desk
•
 7 min read
•
 1,241 words

Coins are, in some respects, an unusually friendly subject for computer vision: they are small, roughly planar, and designed to be recognisable. They are also deceptively hard. The same type can look very different when worn, toned or photographed under raking light, while two distinct dies can differ by a few micrometres of relief. Coin similarity detection therefore sits between two problems, recognising the type of a coin and distinguishing the individual specimen or the die that struck it, and the choice of method depends on which one is being asked.

AI detecting circles on Euro coins using computer vision
Computer vision identifying and outlining individual coins using circle detection algorithms

Three questions that look alike but are not

It helps to separate the tasks. Type classification asks which denomination, country or issue a coin belongs to, and is a standard supervised image classification problem. Similarity retrieval asks which catalogue entries look most like a query coin, and is solved by learning an embedding in which distance reflects visual similarity. Authentication asks whether a coin is genuine, which is a different kind of problem: it is closer to anomaly detection, because counterfeits are rare, heterogeneous and adapt to the detector. A system can be excellent at the first and useless at the third, and published accuracy figures should be read with that distinction in mind.

Finding the coin: circles, edges and the Hough transform

Before any identification, the coin must be located. For flat coins photographed on a plain background, the classical approach is the Hough transform (Duda and Hart, 1972, building on Hough's earlier patent). Each edge point in the image votes for all circle centres and radii consistent with it; peaks in the accumulator space correspond to circles. The gradient-based variant, implemented in common libraries, uses the direction of the edge gradient to cut the voting cost. This is fast and needs no training data, but it is sensitive to parameters such as the allowed radius range and the edge-detection threshold, and it struggles when coins touch, overlap or have heavily textured rims.

Learned segmentation with U-Net

Where backgrounds are cluttered or coins overlap, a learned segmentation model is more robust. U-Net, introduced by Ronneberger, Fischer and Brox in 2015 for biomedical images, uses an encoder that downsamples to capture context and a decoder that upsamples back to full resolution, with skip connections that carry fine spatial detail across. It was designed to work with relatively small annotated sets, which is helpful because pixel-level coin masks are laborious to produce. Segmentation is typically scored with intersection over union or the Dice coefficient, and it is worth reporting these separately from downstream identification accuracy so that errors can be attributed to the right stage.

Hough Transform vs U-Net coin segmentation comparison
Comparison of Hough Transform and U-Net segmentation techniques applied to coins from different countries

Describing the coin: from local features to embeddings

Once a coin is isolated, it must be represented in a way that supports comparison. Before deep learning, the standard tools were local feature descriptors such as SIFT (Lowe, 2004), which detect keypoints stable under scale and rotation and match them between images. These are well suited to coins because the design (portrait, lettering, ornament) provides many distinctive keypoints, and rotation invariance matters since coins are placed at arbitrary orientations. Their weakness is relief: lighting changes alter the appearance of embossed detail, and wear erases features, so matches degrade.

Modern pipelines learn the representation. A convolutional network maps each image to a vector, trained so that images of the same coin type land close together and different types land apart. Two training ideas are common. Siamese networks learn from pairs labelled "same" or "different" (see Koch, Zemel and Salakhutdinov, 2015, for one-shot recognition), and triplet losses, popularised for faces by FaceNet (Schroff et al., 2015), pull an anchor toward a positive example and push it away from a negative one by a margin. At query time, similarity is the distance between embeddings, which enables fast nearest-neighbour search across a large catalogue and, importantly, works for classes unseen during training, since a new coin type needs only a reference image, not retraining.

Machine learning detecting and labeling coin denominations
An ML model detecting and classifying coin denominations (1, 5, 10, 25 cent) with bounding boxes in real time

Evaluation: where coin studies go wrong

Because many photographs of the same coin look nearly identical, naive random splits leak information. If several images of one specimen appear in both training and test sets, the model can succeed by memorising that specimen, and reported accuracy overstates how well it will identify a coin it has never seen. Splits should be made by specimen, and for die-level tasks by die. Other points worth checking:

  • Metrics that match the task. Top-1 and top-5 accuracy for retrieval; per-class recall for rare types, since overall accuracy is dominated by common denominations; for authentication, false accept and false reject rates at a stated threshold, or equal error rate, rather than a single accuracy.
  • Class imbalance. Common circulation coins have thousands of images; rare varieties have a handful. Macro-averaged scores expose the difference.
  • Capture conditions. Tests on studio images tell little about collectors' phone photos. Reporting performance across lighting, background and camera is more informative than a single pooled figure.

What an image can and cannot tell you about authenticity

A photograph captures surface appearance. Many counterfeit indicators are not visible there: alloy composition, mass, density, magnetic response and the metallurgical structure left by striking versus casting. Image models can pick up cast-copy features such as surface porosity, soft detail and a granular field when they are trained on matched genuine and fake examples, but they generalise only as far as the fakes in the training set. An image classifier should therefore be treated as a screening step that prioritises coins for physical examination, not as a replacement for it. Cast and struck replicas also differ widely between forgers, so a model trained on one family of forgeries has uncertain performance on another.

Limitations and open questions

  • Wear and corrosion. Worn types lose exactly the features that embeddings rely on, and ancient coins may be corroded or off-centre struck, with parts of the design missing from the flan.
  • Data scarcity. Rare issues have few images, and reliable labels depend on specialist catalogues whose attribution is sometimes disputed.
  • Die identification. Linking coins to the same die is a task numismatists perform by close comparison; automating it requires alignment at fine scale and is far less mature than type classification.
  • Adversarial adaptation. Once a screening tool is known, forgers can tune their output to pass it.

What researchers should watch

  • Are results reported with splits by specimen or die, and with images from independent photographers?
  • Does the embedding retain performance when a coin type is added without retraining?
  • Is there an uncertainty measure that lets the system defer to a human on worn or unusual pieces?
  • Can multi-view or multi-light capture (for example, several lighting angles) improve relief recovery enough to help with die matching?

References and further reading

  1. Duda R. O., Hart P. E. Use of the Hough Transformation to Detect Lines and Curves in Pictures. Communications of the ACM, 1972.
  2. Ronneberger O., Fischer P., Brox T. U-Net: Convolutional Networks for Biomedical Image Segmentation. MICCAI, 2015.
  3. Lowe D. G. Distinctive Image Features from Scale-Invariant Keypoints. International Journal of Computer Vision, 2004.
  4. Koch G., Zemel R., Salakhutdinov R. Siamese Neural Networks for One-shot Image Recognition. ICML Deep Learning Workshop, 2015.
  5. Schroff F., Kalenichenko D., Philbin J. FaceNet: A Unified Embedding for Face Recognition and Clustering. CVPR, 2015.
  6. Szeliski R. Computer Vision: Algorithms and Applications. Springer.
#machine learning #coin detection #computer vision #AI #numismatics
All Scientific Breakthroughs