Mobile app for on-device structural crack classification. It runs an EfficientNet-B0 model locally with react-native-fast-tflite, so photos are classified without a server or internet connection.
Target users are civil engineers and inspectors doing field assessments.
- Capture a crack photo with the camera or import one from the gallery.
- Classify cracks into four model classes:
flexural,settlement,shear, andcorrosion. - Show confidence, urgency, technical guidance, visual indicators, recommended actions, and ACI references.
- Correct a wrong classification while preserving the original model prediction.
- Store classification history in SQLite.
- Export saved images as a ZIP grouped into
flexural/,shear/,settlement/, andcorrosion/folders.
- Expo SDK 54
- React Native 0.81
- TypeScript
react-native-fast-tfliteexpo-camera,expo-image-picker,expo-image-manipulatorexpo-sqlitejszipandexpo-sharing- Jest with
ts-jest
App.tsx Root screen flow
src/
components/ Reusable UI components
constants/ Model class names and preprocessing constants
screens/ Home, camera, result, and history screens
services/ Classifier, SQLite storage, ZIP export
types/ Shared TypeScript types
utils/ Pure helper logic and unit tests
assets/
data/crack_templates.json Technical result templates
models/ TFLite/CoreML model files
android/ Generated native Android project
Use an Expo dev client. Expo Go will not work because the app uses native modules, including react-native-fast-tflite, expo-sqlite, and camera integrations.
Install dependencies:
npm installStart Metro for a dev-client build:
npm run startRun on Android:
npm run androidRun on iOS:
npm run iosRun the web target for UI-only checks:
npm run webRun TypeScript:
npm run typecheckRun unit tests:
npm run testCI test command:
npm run test:ciThe classifier expects:
- Input size:
224x224 - RGB image data
- ImageNet normalization
- NCHW tensor layout:
[1, 3, 224, 224] - Output order:
flexural,settlement,shear,corrosion
The app maps model class names to template entries in assets/data/crack_templates.json through CLASS_TO_TEMPLATE_KEY.
GitHub Actions workflow:
.github/workflows/android-release.yml
It builds APKs for:
universalusing all supported architecturesarmeabi-v7aarm64-v8ax86x86_64
Push a tag like this to create a release:
git tag v1.0.0
git push origin v1.0.0The workflow runs typecheck, unit tests, generates the Android native project, builds release APKs per architecture plus a universal APK, uploads artifacts, and attaches APKs to the GitHub Release.
Generate a private release keystore locally:
keytool -genkeypair \
-v \
-storetype PKCS12 \
-keystore crack-detector-release.keystore \
-alias crack-detector \
-keyalg RSA \
-keysize 2048 \
-validity 10000Keep this file private. Do not commit it.
Encode it for GitHub Actions:
base64 -i crack-detector-release.keystore | pbcopyOn Linux, use:
base64 -w 0 crack-detector-release.keystoreAdd these repository secrets in GitHub under Settings > Secrets and variables > Actions:
ANDROID_KEYSTORE_BASE64: base64 output of the keystore fileANDROID_KEYSTORE_PASSWORD: keystore passwordANDROID_KEY_ALIAS: key alias, for examplecrack-detectorANDROID_KEY_PASSWORD: key password
The release workflow decodes the keystore at build time and signs each architecture-specific APK with these secrets.