Thursday, October 20, 2011

Progress towards a graphical UI for TEVS

I'd hoped to have a tested graphical user interface version of TEVS ready before November, but that has proven impossible. As I won't be able to touch this for some time, I've posted the existing code in an alternate repository, tevs.gui, at tevs.googlecode.com. Though it works soup-to-nuts for scanning, processing, counting, and reporting at my setup, it is untested, undocumented, and incomplete.

Here are screenshots, from which behavior can be inferred. Clicking the images will get you larger versions.

There are three control panel tabs, corresponding to the stages of the process.

First tab on control panel is for scanning. The GUI calls out to a separate scanning process, which gets the scans and writes them to files. The GUI then reads the files. Controls allow for choosing endorser if available, changing resolution, selecting duplex/simplex and ballot size. If a scanner is not found (unplugged, bad connection) the user can check and click "Search for scanner" to connect. If it is present, its type is displayed. More than one scan source is not now handled.




Second tab is for processing scanned ballots into a vote database, getting info from the database, signing and writing all info to a DVD. The signing and writing process is done by prompting a user through a terminal window dialog with tar, gpg, etc..., and encouraging them NOT to do the signing on the actual machine running TEVS.

Decisions about how to insist on an educated user have been the most difficult part of this process -- it is pointless to produce a tool that is simply trusted. The disk's user is free to alter the database at will -- the assumption here is that the group using the tool is independent of the elections office and trusts itself



Merging OCR variants -- templates are built automatically on supported vendor ballot designs when the system encounters new ballot types (as in new precincts, for example), but the OCR in building the templates will sometimes read the same contest or choice with different errors from one precinct to the next. The system makes its best guesses and then asks you to confirm or alter associations between different variants of contests and choices before it totals things up. To ignore this, all one needs to do is click "Done" and the system skips on to overvote processing and counting up the votes.



Showing results -- they can also be put into a PDF and printed.


Third tab is for displaying results on ballots. You can walk through ballots sequentially. You can also query the database for ballots with particular characteristics (ambiguous votes, overvotes, particular precinct, etc...), and can click through the resulting list to see those ballots.



The user interface is done using Gtk, and its appearance is generated via Glade, a user interface design tool. This makes it easily alterable and translatable. Tasks like scanning, database access, and ballot processing are farmed out to other processes, generally slight modifications of the non-UI routines that already exist.

Friday, September 2, 2011

Scotia August 2011 Results


We've scanned the 151 ballots for Scotia's August 2011 election and counted them with TEVS. The results are below.

Interestingly, because one voter voted for three candidates and then wrote them in, marking three write-in boxes, that voter's votes in the Director contest were considered invalid -- only five boxes can be selected, and if more than five are selected, none are counted. That ballot, with the voter's handwriting removed, is the image you see above.

Because this is such a small set of ballots, we've chosen to hide the handwriting of the write-in votes by modifying the few scans with write-ins to erase the handwriting and replace it with standard text. The scans are here (29 megabytes), the digital signature to validate the scans is here, a screenshot of TEVS showing the first ballot is here, and the detailed spreadsheets are here (as Open Office) and here (as Excel).

(Note: "ambiguous" in this context doesn't mean the voter was ambiguous, but that TEVS had contradictory results on the two different tests it uses to decide if a mark is enough to register as a vote. Such votes are hand-checked.)

count | choice_text
-------+-----------------------
68 | CAROLYN DEPUCCI
70-1 | RICK WALSH (one vote labeled ambiguous inspected and removed from ballot 77)
96 | JAMES BARNES
48 | MARILYN SANDERSON
109 | JOHN BROADSTOCK
140 | YES
69 | KEVIN LALOLI
40 | WILLIAM BILL STEPHENS
103 | GAYLE MCKNIGHT
39 | JOHN CANESSA
9 | NO
7 | Writein
(12 rows)

Not included above due to "overvote" in contest:

substring | choice_text
--------------------+-----------------------
roc/001/001067.jpg | GAYLE MCKNIGHT
roc/001/001067.jpg | JAMES BARNES
roc/001/001067.jpg | JOHN CANESSA
roc/001/001067.jpg | MARILYN SANDERSON
roc/001/001067.jpg | WILLIAM BILL STEPHENS
roc/001/001067.jpg | RICK WALSH
roc/001/001087.jpg | GAYLE MCKNIGHT
roc/001/001087.jpg | JAMES BARNES
roc/001/001087.jpg | JOHN CANESSA
roc/001/001087.jpg | MARILYN SANDERSON
roc/001/001087.jpg | WILLIAM BILL STEPHENS
roc/001/001087.jpg | RICK WALSH
roc/001/001088.jpg | CAROLYN DEPUCCI
roc/001/001088.jpg | JOHN BROADSTOCK
roc/001/001088.jpg | MARILYN SANDERSON
roc/001/001088.jpg | Writein
roc/001/001088.jpg | Writein
roc/001/001088.jpg | Writein
roc/001/001026.jpg | JAMES BARNES
roc/001/001026.jpg | Writein
roc/001/001026.jpg | Writein
roc/001/001026.jpg | Writein
roc/001/001026.jpg | Writein
roc/001/001026.jpg | Writein
(24 rows)

Friday, July 15, 2011

A Voting System without "Spoilers" -- Approval Voting

A perpetual problem with our current voting system is that it subjects third-party candidates to charges that they are "spoilers" while forcing voters to vote strategically rather than honestly. That is, if you really like candidate C, but realize that the most likely winner is either candidate A or candidate B, you may feel obligated to vote for A to prevent a win by B.

How hard is it to get around this problem? Not hard at all -- it just means considering the system that was used to vote for the first four U.S. presidents. That's Approval Voting.

Under approval voting, you can vote for as few or as many choices as you like in each election. Then, every vote for every candidate is added up, and the candidate with the most votes (approvals) wins. Easy.

More here, at the Center for Election Science.

Tuesday, June 7, 2011

TEVS Live CD now online

One of the most frustrating things about the TEVS software has been its dependence on a modified version of an open source image utility library. It was an early mistake but, because it worked for me on my setup, it wasn't until very recently that I removed the dependency on this modified version. The dependency made it needlessly difficult for others to build TEVS. But it's gone now.

In addition, a lot of cleanup, documenting, and restructuring of the ballot handling code has been done by James Frasche, thanks to funding provided by Lori Grace and the Grace Institute for Democracy and Election Integrity. (Thanks!) This will make it easier for people to add handling for new ballot types going forward.

So it finally makes sense to make a Live CD available to those who might want to have an environment in which they can run the code, figure out what they want to add or improve, and just add and improve it.

The Live CD is a version of the Ubuntu Live CD which includes TEVS, all the programs it uses, a few sample ballot images, and a link to the code repository at tevs.googlecode.com. While it's NOT slick, it does provide a few buttons that allow you to run TEVS on a small set of provided ballot images and see the results, see the XML templates that get built, then run it again on the same images to re-use the templates, then run it on the images at a lower resolution, to see the difference in speed between 300 dpi images and 150 dpi images. Because the Live CD's 900 meg size won't fit on a CD, it needs to be burned onto a DVD. Once you've burned it to a DVD, though, you can just pop it into any PC or modern Mac and run Ubuntu and TEVS without installing them on your machine.

If you've never used Ubuntu Linux, don't worry. It should be perfectly straightforward how to use things for the demo. You can also see how easy it is to use Ubuntu for things like web browsing and general office work.

The Live CD should be a good tool for demonstrating the possibilities TEVS provides. It can be downloaded from this link: http://dl.dropbox.com/u/18212385/customdist.iso


Monday, March 21, 2011

TEVS Source Code Update Online

A Mercurial repository of the TEVS source code is now online at tevs.googlecode.com.

The entry point for the data extraction code is at tevs/main.py, and the generic ballot handling code is at tevs/Ballot.py. The display code, in tevs/TEVS.py, will be undergoing major modifications.

The reason for putting the code online at this point is not that it's ready for prime time, but that the data extraction part has now been restructured to the point that it's no longer mostly a waste of time to use it as a starting point.

Friday, December 24, 2010

Happy Holidays

May the human spirit prevail.

(n.b.: Jonathan is no relation, nor is the composer.)

Wednesday, December 1, 2010

Some Preliminary Results for November 2010

I've run the set of Transparency Project scans through the counting software and have preliminary results. More precise results will need to wait until I've had an opportunity to go through things much more carefully, but I feel comfortable releasing the percentages I've calculated for some of the races.

For some close races which had substantial interest, here are my preliminary percentages compared with the official results. Please keep in mind that the variances of 1/10 of a percent are very reasonable given that my count still needs to properly resolve over-votes -- where there were too many votes in a contest -- and is still missing approximately 150 sheets which were refused by the counting software. There are also a small number of very-lightly-marked ballots from which a very few additional votes will be harvested, but these should have little effect on the percentages.

DA
Gallegos 52.0 vs county 52.08
Jackson 47.7 vs county 47.61

Eureka Ward 3
Newman 44.3 vs county 44.18
Kuhnel 42.0 vs county 41.95
Manns 13.5 vs county 13.59

Supervisor District 5
Cleary 49.1 vs county 49.04
Sundberg 50.5 vs county 50.38